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
UIView
instance 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
Coordinator
instance to coordinate with theUIView
.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)