Swift-MVVMC-SimpleExample icon indicating copy to clipboard operation
Swift-MVVMC-SimpleExample copied to clipboard

Is that possible to implement MVVM-C for SwiftUI?

Open bengidev opened this issue 1 year ago • 1 comments

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

bengidev avatar Dec 09 '24 08:12 bengidev

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()) :)

wojciech-kulik avatar Dec 14 '24 22:12 wojciech-kulik