UIViewControllerRepresentable
public protocol UIViewControllerRepresentable : Renderable, View
Use this protocol to create a custom View
that represents a UIViewController
.
-
Declaration
Swift
associatedtype UIViewControllerType : UIViewController
-
Declaration
Swift
typealias UIContext = UIViewControllerRepresentableContext<Self>
-
Declaration
Swift
associatedtype Coordinator = Void
-
Creates a
UIViewController
instance to be presented.Declaration
Swift
func makeUIViewController(context: UIContext) -> UIViewControllerType
-
Updates the presented
UIViewController
(and coordinator) to the latest configuration.Declaration
Swift
func updateUIViewController(_ uiViewController: UIViewControllerType, context: UIContext)
-
Creates a
Coordinator
instance to coordinate with theUIViewController
.Coordinator
can be accessed viaContext
.Declaration
Swift
func makeCoordinator() -> Coordinator
-
body
Extension methodDeclaration
Swift
public var body: View { get }
-
createView(context:
Extension method) Declaration
Swift
public func createView(context: Context) -> UIView
-
updateView(_:
Extension methodcontext: ) Declaration
Swift
public func updateView(_ view: UIView, context: Context)