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
content
The root view of the ArgoKit view hierarchy that you want to manage using this hosting controller.
frame
The frame rectangle for the new view object.
safeArea
true 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
content
The root view of the ArgoKit view hierarchy that you want to manage using this hosting controller.
origin
The position for the new view object.
width
the specified width of the host view,default is UIScreen.main.bounds.width.
height
the 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) -> CGSize
Parameters
size
The 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) -> CGSize
Parameters
width
The width for which the view should calculate its best-fitting width.when width = .nan A new width that fits the receiver’s subviews.
height
The 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 }