Most large iOS apps consist of four major components. User Interface, Business Logic, Service and Storage. This project will hit multiple different REST APIs and also persist data. In order to make our app "scalable" we will spread responsibilites out into all 4 layers.
- Render everything that the user should see.
- Listen for all input from the user.
- Handle as little logic as possible - offload it to the business logic layer.
- ViewControllers (part of the "V" not the "C" in MVC)
- Custom Views
- Receive inputs from the UI and coordinate them with the other layers (storage, service).
- Send updates back to UI for rendering.
- Acts as the backbone that ties the rest of the app together.
- Model Controllers
- Handle all external communication. (HTTP, Bluetooth, GPS, iCloud/Firebase, etc.)
- Report back to the business logic layer.
- Service for each model (business logic layer asks WeatherService for Weather)
- Manager for each API (WeatherService asks CloudKitManager/URLSessionManager/FirebaseManager, etc. for Data)
- Transport Models (a custom verson of your model that encodes/decodes it for transportation. CKRecord, Codable version, etc.)
- Persist data to disk.
- CoreData
- File persistence
- UserDefaults
- There will also be some files used "app wide".
- Extensions, Enums, Models, etc.
- Feel free to create folders for each of them or to group some into a Utilities/Library/AppWide folder.
- Models
- Views
- Controllers
- Services
- Storage
- Utilities