Embed SwiftUI View in UITabBarController

Anyone have any idea as to how to embed an SwiftUI View in a UITabBarController. From what I understand they were made to contain views made from UIKit and my views are made from SwiftUI so I’m not exactly sure how to use a UITabBarController in the storyboard with the views that I have. Any help would be greatly appreciated!

Answered by WeagleWeagle in 717952022

Just use TabView in App file and put your views in there

Accepted Answer

Just use TabView in App file and put your views in there

There are still a handful of things you can do in UIKit for UITabViewController that you can't in SwiftUI (even with iOS 16). If you want to mix and match, you can use a UIHostingController and shove your SwiftUI view inside one then add the hosting controller as a child of the UITabViewController.

Embed SwiftUI View in UITabBarController
 
 
Q