由于 Swift 5 引入了用于創建視圖的 SwiftUI 框架,但我目前正在使用 Storyboard 進行 Apple Watch 的 UI 設計。
所以我只想知道在同一個 Apple Watch 應用程式中使用 Storyboard 和 Swift UI 的程序。
我看到了這個有沒有辦法在同一個 iOS Xcode 專案中使用故事板和 SwiftUI?但是 WatchOS 上沒有 UIViewController 或 UIHostingController
謝謝
uj5u.com熱心網友回復:
WKHostingController是 WatchKit 的等價物UIHostingController
。
如果您使用WKHostingController
,您將能夠在 watchOS 的故事板中使用 SwiftUI 視圖。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/489755.html