The app for showing quotes
Short project overview
- Quotly is built 100% in clean SwiftUI. All requests handled with native Swift instrument (URLSession).
- Pexels (free images database) was integrated to fetch images for UI improvements. Integration is also 100% native using same URLSession api. (see ImagesLoadingManager file for details and comments)
- No 3rd party code components OR libraries were used.
- Target iOS version 16.4.
- Works on any iPhone screen size.
- Works on xCode 14.3.
- Continue after the image :)
- The app doesn't have any warnings or crashes, fetching quotes errors are properlyy handled (Only connection & bad server response provide with actionable button to reload. badURL and badDecoding are handled and notifying developer to check data-structre or url-building function. Actual user will see them only if JSON-schema is changed on the servers.)
- Quotly works on iOS and iPad (was not optimized & tested for macOS).
- It was built with a MVVM structure, and tests could be implemented easily (both unit & UI).
- Pagination system is impemented (see QuoteViewModel for details and comments)
- Nice (arguable) UI & animations (transitions) added.
- Added share quote function to the detaield quote screen.
Details:
- App uses NavigationStack and routing system built on it for navigating and dependency injections. See (file Router for details)
- App has two different download managers - one for downloading quotes and another one for images.
- Download manager for fetching quotes is generic function, so it's reused to fetch all quotes and just selected quote when needed.
- The app has two separate view models for handling operations of getting data and passing it to views.
- Animations were built as reusable components (including loaders, button animations, transitions).
File Structure:
- Router - manages navigation & dependancy injections
- Managers - QuotesLoadingManager (loads quotes) and ImagesLoadingManager (loads images from Pexel)
- DataModels - contains all data structures - Quotes, Quote, Images, Errors
- ViewModels - QuoteViewModel(manages all quotes ops and passing data to Views) and ImagesViewModel ( manages all images ops and passing loaded image urls to Views.)
- Views (Content View, QuotesListView, QuoteDetailedView, Error View) and View Components (CellView, Gradient, LoaderViews)
Possible next steps for improvements:
- Add bookmarks
- Implement openAI API to get a category for each quote and fetch Image for a cell based on its category
- Add widgets (for iOS 17 add a button to load a new quote to a widget right from the homescreen.)
- Implement UI & Unit tests