SplitView
open class SplitView : UIView
Resizable Split View, inspired by Apple’s Split View for iPadOS and SplitKit
-
The list of views split by the split view.
Declaration
Swift
public var splitSubviews: [UIView] { get }
-
The handles between views
Declaration
Swift
public var handles: [SplitViewHandle]
-
The minimum width/height ratio for each view
The default is 0.0
Declaration
Swift
public var minimumRatio: CGFloat { get set }
-
The animation duration when resizing views
If you specify a negative value or 0, the changes are made without animating them. The default is 0.0 seconds
Declaration
Swift
public var animationDuration: TimeInterval
-
The precision of the movements. 1 is every 10%, 2 is every 1%, etc
The default is 5
Declaration
Swift
public var precision: Int
-
Snap Behavior
Declaration
Swift
public var snap: [SplitViewSnapBehavior] { get set }
-
The axis along which the split views are laid out.
This property determines the orientation of the split views. Assigning the
NSLayoutConstraint.Axis.vertical
value creates a column of views. Assigning theNSLayoutConstraint.Axis.horizontal
value creates a row. The default value isNSLayoutConstraint.Axis.horizontal
.Declaration
Swift
public var axis: NSLayoutConstraint.Axis { get set }
-
Undocumented
Declaration
Swift
public override init(frame: CGRect)
-
Undocumented
Declaration
Swift
public convenience init()
-
Returns a new split view object that manages the provided views.
Declaration
Swift
public convenience init(splitSubviews: [UIView])
Parameters
splitSubviews
The views to be split by the split view.
-
Not implemented
Declaration
Swift
required public init?(coder aDecoder: NSCoder)
-
Adds a view to the end of the splitSupportingViews array
Declaration
Swift
@available(swift 1.3.0) open func addSplitSubview(_ view: UIView, desiredRatio: CGFloat = 0.5, minimumRatio: CGFloat = 0.0, withHandle: SplitViewHandle? = nil)
-
Adds the provided view to the array of split subviews at the specified index.
Declaration
Swift
open func insertSplitSubview(_ view: UIView, at: Int, desiredRatio: CGFloat = 0.5, minimumRatio: CGFloat = 0.0, withHandle: SplitViewHandle? = nil)
-
Removes the provided view from the stack’s array of split subviews.
Declaration
Swift
open func removeSplitSubview(_ view: UIView)
-
The current ratio for all the split subviews
Declaration
Swift
public var ratios: [CGFloat] { get }
-
The minimum ratios for all the split subviews
Declaration
Swift
public var minimumRatios: [CGFloat] { get }
-
Set the minimum ratio for a specific view
Declaration
Swift
public func setMinimumRatio(_ ratio: CGFloat, for view: UIView)
-
A Boolean value that determines whether the split view lays out its split views relative to its layout margins.
If
true
, the stack view will layout its split views relative to its layout margins. Iffalse
, it lays out the split views relative to its bounds. The default isfalse
.Declaration
Swift
public var isLayoutMarginsRelativeArrangement: Bool { get set }