Search code examples
iosswiftxcodestoryboardwatchos

Is there any way to use storyboard and SwiftUI in same iOS Xcode project for Apple Watch?


As Swift 5 introduces the SwiftUI framework for creating the views, but I'm currently using the storyboard for UI design for Apple Watch.

So I just wanted to know the procedure to use Storyboard and Swift UI in same Apple Watch Application.

I saw this Is there any way to use storyboard and SwiftUI in same iOS Xcode project? but there is no UIViewController or UIHostingController on WatchOS

Thanks


Solution

  • WKHostingController is the WatchKit equivalent of UIHostingController.

    If you use WKHostingController, you'll be able to use a SwiftUI view in a storyboard on watchOS.