UIHostingView
public class UIHostingView : UIView
A UIKit view that hosts a ArgoKit view hierarchy.
Example:
let hostView: UIHostingView = UIHostingView(content: Content(), frame:self.view.bounds)
self.view.addSubview(hostView)
-
Undocumented
Declaration
Swift
public var useSafeAreaTop: Bool -
Undocumented
Declaration
Swift
public var useSafeAreaLeft: Bool -
Undocumented
Declaration
Swift
public var useSafeAreaBottom: Bool -
Undocumented
Declaration
Swift
public var useSafeAreaRight: Bool -
Undocumented
Declaration
Swift
public override func layoutSubviews() -
Initializer
Declaration
Swift
public init(content: View, frame: CGRect = CGRect.zero, useSafeArea: Bool = false)Parameters
contentThe root view of the ArgoKit view hierarchy that you want to manage using this hosting controller.
frameThe frame rectangle for the new view object.
safeAreatrue if you want to add the insets that you use to determine the safe area for this view.
-
Initializer size of the host view automatically matches the size of the child view
Declaration
Swift
public init(content: View, origin: CGPoint, width: CGFloat = CGFloat.nan, height: CGFloat = CGFloat.nan)Parameters
contentThe root view of the ArgoKit view hierarchy that you want to manage using this hosting controller.
originThe position for the new view object.
widththe specified width of the host view,default is UIScreen.main.bounds.width.
heightthe specified height of the host view,default is CGFloat.nan.
-
Asks the view to calculate and return the size that best fits the specified size.
Declaration
Swift
public override func sizeThatFits(_ size: CGSize) -> CGSizeParameters
sizeThe size for which the view should calculate its best-fitting size.
Return Value
A new size that fits the receiver’s subviews.
-
Asks the view to calculate and return the size that best fits the specified width and height.
Declaration
Swift
public func sizeThatFits(_ width: CGFloat = .nan, height: CGFloat = .nan) -> CGSizeParameters
widthThe width for which the view should calculate its best-fitting width.when width = .nan A new width that fits the receiver’s subviews.
heightThe height for which the view should calculate its best-fitting height.when height = .nan A new height that fits the receiver’s subviews.
Return Value
A new size that fits the receiver’s subviews.
-
Undocumented
Declaration
Swift
public override var frame: CGRect { get set }
UIHostingView Class Reference