SwiftUI and UIKit

Hi all,

I have been trying to add SwiftUI content to my existing UIKit apps, and I seem to be either missing or understanding something. Here's what I have so far:


When an end user taps a top-right navigation button (help) i'd like the SwiftUI view controller to come up.


1. I am initializing the UIHostingController according to the WWDC Video, and am getting NO errors.

2. I've added a UIHostingController to the storyboard and made connections according to the video, no errors.

3. When I run the app and go to the SwiftUI view controller, the app hangs.


What am I missing?


Thanks,

Dan Uff

Can you stop the app in the debugger and get a stack backtrace? Also, if you could post a small code sample showing how you're presenting your view, and how the SwiftUI view is designed (is it just a collection of static views, or are there callback modifiers like .didAppear() involved, for instance?) that would be really useful.

I'm at work but I'll post it ASAP. Thanks.

SwiftUI and UIKit
 
 
Q