I have kind of gone half-way between a full-blown React model and MVC for iOS development.<p>The last big project I worked on in Swift used an MVVM-style design. But I encapsulated the application state in a Swift enum.<p>The enum adhered to a protocol `AppState` which defined a method to turn an `AppState` into a view controller, as well as a static function to transition a view controller to a new `AppState`. Swift's strong type system ensured that it was very easy to guarantee that every view controller / view model had access to well-defined data types and that the flow of information only happened in one direction.<p>This meant that the entire transition logic for the application sat in one relatively small file that handled how each state could be displayed (and whether special cases were needed if coming from a particular state).<p>So for example, to present an alert in the application a view controller would ask its view model for the next AppState, and then ask to transition to that state.<p>E.g., in the view controller:<p><pre><code> let nextState = viewModel.nextStateForSomeButtonPressed()
AppState.transitionViewToState(self, nextState)
</code></pre>
And the view model's next state logic might be:<p><pre><code> return MyAppState.BasicAlert("Title", "Message")
</code></pre>
The enum .BasicAlert has all the logic needed to transform into a view controller (in this case a `UIAlertController`), and the transitionViewToState has all the logic needed to present that controller.<p>I have since found that this is one of the most pleasurable projects to maintain and update.<p>Edit:<p>This also allowed some nice functions to be written, like:<p><pre><code> func initialApplicationState() -> [AppState]
</code></pre>
Which the AppDelegate uses on startup to display the correct array of view controllers (in this case, the app displays a tutorial sequence on first-run, but that logic is completely decoupled from the AppDelegate).