UIViewRepresentable
public protocol UIViewRepresentable : Renderable, View
Use this protocol to create a custom View that represents a UIView.
-
Declaration
Swift
associatedtype UIViewType : UIView -
Declaration
Swift
typealias UIContext = UIViewRepresentableContext<Self> -
Declaration
Swift
associatedtype Coordinator = Void -
Creates a
UIViewinstance to be presented.Declaration
Swift
func makeUIView(context: UIContext) -> UIViewType -
Updates the presented
UIView(and coordinator) to the latest configuration.Declaration
Swift
func updateUIView(_ uiView: UIViewType, context: UIContext) -
Creates a
Coordinatorinstance to coordinate with theUIView.Coordinatorcan be accessed viaContext.Declaration
Swift
func makeCoordinator() -> Coordinator
-
bodyExtension 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)
View on GitHub
UIViewRepresentable Protocol Reference