Swift-MVVMC-SimpleExample
Swift-MVVMC-SimpleExample copied to clipboard
Is that possible to implement MVVM-C for SwiftUI?
Hello, i want to say thank you for your blogposts and examples of how to implement MVVM-C in simple and clear way. But i want to ask you about implementing this pattern in SwiftUI, is that still possible or not. If it is possible, can you make simple example of how to implement it in SwiftUI. Or if it is not possible, are you have another good pattern, but not over-complicated the project itself?
I hope you will read this. Thank you
Hi! Thank you!
Yes, it is possible, basically you do it the same way as in UIKit, and to present/push ViewControllers you wrap your SwiftUI view with UIHostingController(rootView: YourSwiftUIView()) :)