Can we use SwiftUi to build iOS Today Extension?

廉价感情. 提交于 2020-05-26 04:40:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!