Replies: 3 comments 1 reply
-
I can't really answer for iOS, but I can at least tell you the migration process for me with SwiftUI on macOS and AppKit. I often use the hosting controller more than the view representable since it was relatively easy to integrate and work with, and it worked well for what I wanted to accomplish. I was able to migrate my preference panes to SwiftUI from storyboards with a hosting controller attached to some views in the Preferences Swift package (https://github.com/sindresorhus/Preferences) and it worked pretty well. |
Beta Was this translation helpful? Give feedback.
-
I also went with the former, wrapping SwiftUI views in hosting views. Then you can slowly move to SwiftUI, view by view. For example, in my Dato app, I started by rewriting my preferences window views in SwiftUI (the window itself still being You can see an example here where I partly moved to SwiftUI (different app): sindresorhus/Blear@a991c6b |
Beta Was this translation helpful? Give feedback.
-
Thank you both for your feedback! We've started with the former approach and it works well! One thing we haven't figure out yet (but tbh we did not spend that much time on it) is:
Our first attempt was using NavigationLink but it did not end well. What's the best way to handle this case? Should we have a centralized navigation logic? |
Beta Was this translation helpful? Give feedback.
-
I'll start :) (not sure if it's the right place though)
I have an app in UIKit and I want to start adding SwiftUI interfaces and slowly replace most of the UIKit stuff.
It is better to:
UIHostingController
UIViewRepresentable
What would be the pros and cons?
And if I'm not asking the right question, please let me know, I'm eager to learn :)
Beta Was this translation helpful? Give feedback.
All reactions