Protocol

UIViewControllerRepresentable

A view that represents a UIKit view controller.

Declaration

protocol UIViewControllerRepresentable where Self.Body == Never

Topics

Associated Types

associatedtype Coordinator

A type to coordinate with the view controller.

Required.

associatedtype UIViewControllerType

The type of view controller to present.

Required.

Instance Methods

func makeCoordinator() -> Self.Coordinator

Creates a coordinator instance to coordinate with the view controller.

Required. Default implementation provided.

func makeUIViewController(context: Self.Context) -> Self.UIViewControllerType

Creates a view controller instance to present.

Required.

func updateUIViewController(Self.UIViewControllerType, context: Self.Context)

Updates the presented view controller (and coordinator) to the latest configuration.

Required.

Type Methods

static func dismantleUIViewController(Self.UIViewControllerType, coordinator: Self.Coordinator)

Cleans up the presented view controller (and coordinator) in anticipation of their removal.

Required. Default implementation provided.

Relationships

Inherits From

See Also

UIKit Hosting

protocol UIViewRepresentable

A view that represents a UIKit view.

Beta
struct UIViewRepresentableContext

The context in which updates to an associated UIKit view take place.

Beta
struct UIViewControllerRepresentableContext

The context in which updates to an associated UIKit view controller take place.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software