UIView

class UIView : UIResponder, NSCoding, UIAppearance, UIAppearanceContainer, UIDynamicItem, UITraitEnvironment, UICoordinateSpace, UIFocusEnvironment
  • Adds a view to the end of the receiver’s list of subviews. When working with C4, use this method to add views because it handles the addition of both UIView and View. - parameter subview: The view to be added.

    Declaration

    Swift

    public func add<T>(subview: T?)

    Parameters

    subview

    The view to be added.

  • Adds an array of views to the end of the receiver’s list of subviews. When working with C4, use this method to add views because it handles the addition of both UIView and View. let v = View(frame: Rect(0,0,100,100)) let subv1 = View(frame: Rect(25,25,50,50)) let subv2 = View(frame: Rect(100,25,50,50)) v.add([subv1,subv2]) - parameter subviews: An array of UIView or View subclasses to be added to the receiver

    Declaration

    Swift

    public func add<T>(subviews: [T?])

    Parameters

    subviews

    An array of UIView or View subclasses to be added to the receiver

  • Unlinks the view from the receiver and its window, and removes it from the responder chain. Calling this method removes any constraints that refer to the view you are removing, or that refer to any view in the subtree of the view you are removing. When working with C4, use this method to remove views because it handles the removal of both UIView and View. - parameter subview: The view to be removed.

    Declaration

    Swift

    public func remove<T>(subview: T?)

    Parameters

    subview

    The view to be removed.

  • Moves the specified subview so that it appears behind its siblings. When working with C4, use this method because it handles both UIView and View. - parameter subview: The subview to move to the back.

    Declaration

    Swift

    public func sendToBack<T>(subview: T?)

    Parameters

    subview

    The subview to move to the back.

  • Moves the specified subview so that it appears on top of its siblings. When working with C4, use this method because it handles both UIView and View. - parameter subview: The subview to move to the front.

    Declaration

    Swift

    public func bringToFront<T>(subview: T?)

    Parameters

    subview

    The subview to move to the front.