在目前阶段,SwiftUI 很难独立开发一款功能强大的 App,还是需要与 UIKit 一起合作,借助 UIKit 成熟完善的知识体系,二者相互嵌套形成混合开发。
UIKit in SwiftUI
UIKitSwiftUIUIViewUIViewRepresentableUIViewControllerUIViewControllerRepresentable
UIViewRepresentable
要使 UIView 在 SwiftUI 中可用,需要用UIViewRepresentable对 UIView 进行包装。UIViewRepresentable中主要有两个...