Implementing useless MVVM with SwiftUI

Watching “Clean MVVM” in SwiftUI

A quick code review while waiting to play Elden Ring

Came across this gem (Implementing Clean MVVM With SwiftUI)on google.

Rename NotificationSettingsViewModel to NotificationSettingsHandler and nothing changes

Look, I get it. You want view state changes to go through view model.

vm.doSomething() // vm.data = "newdata", trigger view update
struct Model: View {
@State var data = "somedata"
func doSeomthing() {
data = "newdata" // trigger view update
}
}

Nested reference type objects

The “clean MVVM” guide passes 3 managers as argument to view model.

OOP vs POP

You can tell whether a dev is familiar with POP or not by checking if he has this urge to create a shit load of managers / view models.

vm1.settingManager = settingManager 
// settingManager conform to SettingManager

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store