UIView

Undocumented

  • x

    quick access to x

    Declaration

    Swift

    public var x: CGFloat
  • y

    quick access to y

    Declaration

    Swift

    public var y: CGFloat
  • w

    shorthand for view width

    Declaration

    Swift

    public var w: CGFloat
  • h

    shorthand for view height

    Declaration

    Swift

    public var h: CGFloat
  • Set corner radius

    Parameter

    Parameter radius: radius

    Declaration

    Swift

    public func setCornerRadius(radius: CGFloat)

    Parameters

    radius

    radius

  • add shadow for view

    Declaration

    Swift

    public func addShadow(offset: CGSize, radius: CGFloat, color: UIColor, opacity: Float, cornerRadius: CGFloat? = nil)
  • Add border

    • Parameters:
      • width: border thickness
      • color: border color

    Declaration

    Swift

    public func addBorder(width: CGFloat, color: UIColor)

    Parameters

    width

    border thickness

    color

    border color

  • add only top border

    • Parameters:
      • size: border thickness
      • color: border color

    Declaration

    Swift

    public func addBorderTop(size: CGFloat, color: UIColor)

    Parameters

    size

    border thickness

    color

    border color

  • add only top border with padding

    • Parameters:
      • size: border thickness
      • color: border color
      • padding: padding to size

    Declaration

    Swift

    public func addBorderTopWithPadding(size: CGFloat, color: UIColor, padding: CGFloat)

    Parameters

    size

    border thickness

    color

    border color

    padding

    padding to size

  • add only bottom border

    • Parameters:
      • size: border thickness
      • color: border color

    Declaration

    Swift

    public func addBorderBottom(size: CGFloat, color: UIColor)

    Parameters

    size

    border thickness

    color

    border color

  • add only left border

    • Parameters:
      • size: border thickness
      • color: border color

    Declaration

    Swift

    public func addBorderLeft(size: CGFloat, color: UIColor)

    Parameters

    size

    border thickness

    color

    border color

  • add only right border

    • Parameters:
      • size: border thickness
      • color: border color

    Declaration

    Swift

    public func addBorderRight(size: CGFloat, color: UIColor)

    Parameters

    size

    border thickness

    color

    border color

  • remove constraint

    Parameter

    Parameter constraint: existing constraint

    Declaration

    Swift

    public func autoRemoveConstraint(_ constraint : NSLayoutConstraint?)

    Parameters

    constraint

    existing constraint

  • Draw circle over view

    • Parameters:
      • fillColor: fill color
      • strokeColor: stroke color
      • strokeWidth: stroke width

    Declaration

    Swift

    public func drawCircle(fillColor: UIColor, strokeColor: UIColor, strokeWidth: CGFloat)

    Parameters

    fillColor

    fill color

    strokeColor

    stroke color

    strokeWidth

    stroke width

  • Draw stroke

    • Parameters:
      • width: stroke width
      • color: stroke color

    Declaration

    Swift

    public func drawStroke(width: CGFloat, color: UIColor)

    Parameters

    width

    stroke width

    color

    stroke color