This is a CleanSwift template modified from the original, to accomodate common project usage.
-
All Files
- All file templates are updated so that upon scene generation, the app still works without throwing errors.
- Pre-built with 4 common use cases:
- Upon entering a screen -
fetchFromLocalDataStore(with:)
- There's almost always local data to be displayed on the screen.
- Upon entering a screen -
fetchFromRemoteDataStore(with:)
- Sometimes a data need to be fetched from an external source.
- This use case decouples from local data fetching use case and allows it to be reused if needed (ie. Pull-To-Refresh).
- Tracking analytics -
trackAnalytics(with:)
- Sometimes a triggered UI element needs to be tracked for app improvements.
- This use case made it easier.
- Upon leaving a screen -
perform<SCENE_NAME>(with:)
- In order to leave a screen, a use case is almost always needed.
- Upon entering a screen -
-
Models
- The template generates a file appended with the word
models
to make it more obvious.
- The template generates a file appended with the word
-
Interactor, Presenter & ViewController
- Each Use Case logic would have the comment header
// MARK: - Use Case -
for better readability between the Use Case & other functions.
- Each Use Case logic would have the comment header
-
Unit Test
- The templates are also updated to test the pre-built use cases.
- A template that is written using the Quick and Nimble libraries are also added if it's preferred over XCTest.
-
Removed
UICollectionViewController
andUITableViewController
templates are removed since the templates use theUIViewController
templates anyway.
-
Clone this repository
-
From this repository:
To install the Clean Swift Xcode templates,run:
$ make install_templates
To uninstall the Clean Swift Xcode templates, run:
$ make uninstall_templates
To learn more about Clean Swift and the VIP cycle, read:
There is a sample app available at: