SwiftUI MVVM Demo Project using RandomUser API for fetching users.
User Directory App aims to develop a straightforward iOS app that presents a comprehensive list of random users.
- Fetching Random Users
- Pagination ( once the user reaches the end of the list new values will be fetched by incrementing offset and triggering an api request )
- Network Monitering ( once the user gets offline an error will be shown and only cached values will be presented)
- Caching and Offline Support ( cached results will be appeneded to newly fetched values and there is a visual indication in each user row )
- Encryption and Decryption
- Error Handling
- Display Gender Distribution
- Display Cached/New Distribution and clear cache for testing purposes
MVVM (Model-View-ViewModel) was chosen as the architecture for this app due to its benefits. It provides a clear separation of concerns between the Model, View, and ViewModel components. The architecture leverages data binding mechanisms to automatically update the UI when the Model changes, reducing manual synchronization.
Order of events :
- view model is responsible for communicating with network service
- fetching results
- updating app state
- content view will update UI based on app state
The app utilizes RandomUsers API for fetching users.
actual device advised - network monitoring creates some issues on simulator