UIView

extension UIView
extension UIView: CSHasLayoutProtocol
  • Undocumented

    Declaration

    Swift

    @discardableResult
    @objc
    public class func construct(defaultSize: Bool = false) -> Self
  • Undocumented

    Declaration

    Swift

    public class func construct(owner: NSObject? = nil, xib: String) -> Self
  • Undocumented

    Declaration

    Swift

    public class func construct(width: CGFloat, height: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    public class func construct(left: CGFloat, top: CGFloat, width: CGFloat, height: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    public class func construct(width: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    public class func construct(height: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    public class func construct(color: UIColor) -> Self
  • Undocumented

    Declaration

    Swift

    public class func construct(frame: CGRect) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    @objc
    open func construct() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func debugLayoutByRandomBorderColor() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func debugLayoutByRandomBackgroundColor() -> Self
  • Undocumented

    Declaration

    Swift

    public func child(at condition: (UIView) -> Bool) -> UIView?
  • Undocumented

    Declaration

    Swift

    public var parent: UIView { get }
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func setAutoresizingDefaults() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flexibleLeftTop() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flexibleLeftBottom() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flexibleWidthHeight() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flexibleWidth() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flexibleHeight() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fixedWidth() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fixedHeight() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flexibleLeft() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flexibleTop() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flexibleRight() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flexibleBottom() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fixedLeft() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fixedTop() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fixedRight() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fixedBottom() -> Self
  • Undocumented

    Declaration

    Swift

    func isFixedLeft() -> Bool
  • Undocumented

    Declaration

    Swift

    func isFixedTop() -> Bool
  • Undocumented

    Declaration

    Swift

    func isFixedRight() -> Bool
  • Undocumented

    Declaration

    Swift

    func isFixedBottom() -> Bool
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func add<View>(view: View, onCreate: ((View) -> ())? = nil) -> View where View : UIView
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func add<View>(before view: View, onCreate: ((View) -> ())? = nil) -> View where View : UIView
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func show(in parent: UIView) -> Self
  • Undocumented

    Declaration

    Swift

    func hideIn()
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func add(all views: UIView...) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func add<View>(view: View, index: Int, _ apply: ((View) -> ())? = nil) -> View where View : UIView
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func set<View>(view: View, index: Int, _ apply: ((View) -> ())? = nil) -> View where View : UIView
  • Undocumented

    Declaration

    Swift

    func findPrevious(of subview: UIView, skipHidden: Bool = true) -> UIView?
  • Undocumented

    Declaration

    Swift

    var lastVisibleSubview: UIView? { get }
  • Undocumented

    Declaration

    Swift

    func findVisibleSubviewBackwards(from index: Int) -> UIView?
  • Undocumented

    Declaration

    Swift

    func findLastSubviewOf(type someType: AnyClass) -> UIView?
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func clearSubviews() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func removeAllSubviews() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func horizontalGrid<View>(add view: View, margin: CGFloat = 0, columns: Int = 1) -> View where View : UIView
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func verticalGrid<View>(add view: View, margin: CGFloat = 0, rows: Int = 1) -> View where View : UIView
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func addBottomSeparator(height: CGFloat = 0.5, color: UIColor = .darkGray) -> UIView
  • Undocumented

    Declaration

    Swift

    static func row(left leftView: UIView, margin: CGFloat = 0, right rightView: UIView) -> Self
  • Undocumented

    Declaration

    Swift

    func row(left leftView: UIView, margin: CGFloat = 0, right rightView: UIView) -> CSView
  • Undocumented

    Declaration

    Swift

    @discardableResult
    @objc
    open func heightToFit() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func heightAsPrevious() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func widthAsHeight() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func heightAsWidth() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func defaultSize() -> Self
  • Undocumented

    Declaration

    Swift

    var availableHeight: CGFloat { get }
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func heightByLastSubview(padding: CGFloat = 0, minimum: CGFloat = 0) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func heightByLastVisibleSubview(padding: CGFloat = 0, minimum: CGFloat = 0) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func size(_ size: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func size(_ size: CGSize) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func size(_ width: CGFloat, _ height: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    var size: CGSize { get set }
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func resizeToFitSubviews() -> Self
  • Undocumented

    Declaration

    Swift

    func sizeThatFitsSubviews() -> CGSize
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func frame(_ rect: CGRect) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func width(_ width: CGFloat, height: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func add(left value: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func add(top value: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func add(right value: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func add(bottom value: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func add(width value: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func add(height value: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func add(width: CGFloat, height: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func remove(width value: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func remove(height value: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func resize(padding: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    @objc
    func resizeToFit() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    @objc
    func resizeToFit(padding: CGFloat = 0) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    @objc
    func widthToFit() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    @objc
    func widthToFitSubviews() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    @objc
    func heightThatFitsSubviews() -> CGFloat
  • Undocumented

    Declaration

    Swift

    @discardableResult
    @objc
    func heightToFitSubviews() -> Self
  • Undocumented

    Declaration

    Swift

    func saveAndClearSubviewsAutoresizingMasks() -> [UIView.AutoresizingMask]
  • Undocumented

    Declaration

    Swift

    func restoreSubviewsAutoresizing(masks: [UIView.AutoresizingMask])
  • Undocumented

    Declaration

    Swift

    @objc
    func widthThatFits() -> CGFloat
  • Undocumented

    Declaration

    Swift

    @objc
    func heightThatFits() -> CGFloat
  • Undocumented

    Declaration

    Swift

    func hideByHeight(if condition: Bool) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fill(horizontal margin: (left: CGFloat, right: CGFloat)) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fill(horizontal margin: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    func fill(vertical margin: (top: CGFloat, bottom: CGFloat)) -> Self
  • Undocumented

    Declaration

    Swift

    func fill(vertical margin: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fill(left margin: CGFloat, flexible: Bool = false) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fill(from: UIView, left: CGFloat, flexible: Bool = false) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fill(top margin: CGFloat, flexible: Bool = false) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fill(bottom: CGFloat, flexible: Bool = false) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fill(bottom: CGFloat, from view: UIView, flexible: Bool = false) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flex(to view: UIView, bottom: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flexToPrevious(bottom: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fill(top: CGFloat, bottom: CGFloat, flexible: Bool = false) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fill(right: CGFloat, flexible: Bool = false) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fill(right: CGFloat, from view: UIView, flexible: Bool = false) -> Self
  • Undocumented

    Declaration

    Swift

    func position(left: CGFloat, top: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    var position: CGPoint { get set }
  • Undocumented

    Declaration

    Swift

    func position(_ point: CGPoint) -> Self
  • x

    Undocumented

    Declaration

    Swift

    var x: CGFloat { get }
  • y

    Undocumented

    Declaration

    Swift

    var y: CGFloat { get }
  • Undocumented

    Declaration

    Swift

    var left: CGFloat { get set }
  • top

    Undocumented

    Declaration

    Swift

    var top: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    var right: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    var bottom: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    var fromRight: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    var fromBottom: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    var leftFromRight: CGFloat { get }
  • Undocumented

    Declaration

    Swift

    var topFromBottom: CGFloat { get }
  • Undocumented

    Declaration

    Swift

    var screenTop: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    var screenBottom: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    func center(_ point: CGPoint) -> Self
  • Undocumented

    Declaration

    Swift

    func center(_ x: CGFloat, _ y: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    var centerTop: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    var centerLeft: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func center(y: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func center(x: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func center(top y: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func center(left x: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func centerTop(as view: UIView) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func centerLeft(as view: UIView) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func centerVertical(as view: UIView) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func centerHorizontal(as view: UIView) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func centerVerticalAsPrevious() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func centered() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func centeredVertical() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func centeredHorizontal() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(left: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(_ view: UIView?, left: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fromPrevious(left: CGFloat, skipHidden: Bool = true) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(top: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(safeTop: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(_ view: UIView?, top: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fromPrevious(top: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fromPrevious(bottom: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fromLeftAsPrevious(offset: CGFloat = 0) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(right: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fromPrevious(right: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(_ view: UIView?, right: CGFloat)
        -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(bottom: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(safeBottom: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(_ view: UIView?, bottom: CGFloat)
        -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(bottomRight: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(left: CGFloat, top: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(topLeft: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(topRight: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(left: CGFloat, bottom: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(bottom: CGFloat, left: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(right: CGFloat, top: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(top: CGFloat, right: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(right: CGFloat, bottom: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(bottom: CGFloat, right: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func from(left: CGFloat, top: CGFloat, width: CGFloat, height: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func matchParent(margin: CGFloat = 0) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func matchParent(margin: (horizontal: CGFloat, vertical: CGFloat)) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func matchParentWidth(margin: CGFloat = 0) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func matchParentWidth(margin: (left: CGFloat, right: CGFloat)) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func matchParentHeight(margin: CGFloat = 0) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func asParentHeight(margin: CGFloat = 0) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func matchParentHeight(margin: (top: CGFloat, bottom: CGFloat)) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flex(bottom: CGFloat, flexible: Bool = true) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flex(right: CGFloat, flexible: Bool = true) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func flex(to view: UIView, right: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func widthBy(right: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func heightBy(bottom: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fixedBottom(height: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func fixedRight(width: CGFloat) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func alignHorizontalLayout() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func alignHorizontal(margin: CGFloat = 0) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func alignVerticalLayout() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func alignVertical(margin: CGFloat = 0) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func alignHorizontalGrid(margin: CGFloat = 0, columns: Int = 1) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func alignVerticalGrid(margin: CGFloat = 0, rows: Int = 1) -> Self
  • Undocumented

    Declaration

    Swift

    var safeWidth: CGFloat { get }
  • Undocumented

    Declaration

    Swift

    var safeHeight: CGFloat { get }
  • Undocumented

    Declaration

    Swift

    var safeSize: CGSize { get }
  • Undocumented

    Declaration

    Swift

    public var safeTop: CGFloat { get }
  • Undocumented

    Declaration

    Swift

    public var safeBottom: CGFloat { get }
  • Undocumented

    Declaration

    Swift

    public var safeRight: CGFloat { get }
  • Undocumented

    Declaration

    Swift

    public var safeLeft: CGFloat { get }
  • Undocumented

    Declaration

    Swift

    public var layoutFunctions: CSEvent<Void> { get }
  • Undocumented

    Declaration

    Swift

    public var eventLayoutSubviewsFirstTime: CSEvent<Void> { get }
  • Undocumented

    Declaration

    Swift

    public var isDidLayoutSubviews: Bool { get set }
  • Undocumented

    Declaration

    Swift

    public var isLayoutCreated: Bool { get set }
  • Undocumented

    Declaration

    Swift

    @objc
    open func onLayoutSubviewsFirstTime()
  • Undocumented

    Declaration

    Swift

    @objc
    open func onCreate()
  • Undocumented

    Declaration

    Swift

    @objc
    open func onCreated()
  • Undocumented

    Declaration

    Swift

    @objc
    open func onUpdate()
  • Undocumented

    Declaration

    Swift

    @discardableResult
    @objc
    open func onLayout() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func updateLayout(forced: Bool = false) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func updateLayoutForced() -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func updateLayoutLater(forced: Bool = false) -> Self
  • Undocumented

    Declaration

    Swift

    public func remove<View>(view: View) where View : UIView
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func add<View: UIView>(
        view: View,
        onCreate: ArgFunc<View>? = nil,
        onLayout: @escaping ArgFunc<View>) -> View
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func add<View: UIView>(
        view: View,
        onCreate: Func? = nil,
        onLayout: @escaping Func) -> View
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func layout<View>(_ view: View, onLayout: @escaping (View) -> Void) -> View where View : UIView
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func layout(function: @escaping Func) -> Self
  • Undocumented

    Declaration

    Swift

    @discardableResult
    public func layout(function: @escaping (`Self`) -> Void) -> Self
  • Undocumented

    Declaration

    Swift

    public func removeFromLayout()
  • Undocumented

    Declaration

    Swift

    public class func wrap<Wrapped>(_ view: Wrapped, padding: CGFloat) -> CSWrapper<Wrapped> where Wrapped : UIView
  • Undocumented

    Declaration

    Swift

    public class func wrap<Wrapped>(_ view: Wrapped, horizontal padding: CGFloat) -> CSWrapper<Wrapped> where Wrapped : UIView
  • Undocumented

    Declaration

    Swift

    public class func wrap<Wrapped>(_ view: Wrapped, vertical padding: CGFloat) -> CSWrapper<Wrapped> where Wrapped : UIView
  • Undocumented

    Declaration

    Swift

    public class func wrap<Wrapped: UIView>(_ view: Wrapped, paddingLeft: CGFloat = 0, paddingRight: CGFloat = 0,
                                            paddingTop: CGFloat = 0, paddingBottom: CGFloat = 0) -> CSWrapper<Wrapped>