问题
I want to use Swift UI to build iOS's Today Extensions, but I don't know how to get started.
回答1:
Check this UIHostingController
tutorial out, easy, straightforward and works like a charm: https://medium.com/@code_cookies/swiftui-embed-swiftui-view-into-the-storyboard-a6fc96e7a0a1
回答2:
Using an instance of UIHostingController as your NSExtensionPrincipalClass to instantiate your SwiftUI view should work on iOS 13.
来源:https://stackoverflow.com/questions/58490571/can-we-use-swiftui-to-build-ios-today-extension