UIView

class UIView : UIResponder, NSCoding, UIAppearance, UIAppearanceContainer, UIDynamicItem, UITraitEnvironment, UICoordinateSpace, UIFocusItem, CALayerDelegate
  • Corner radius of view’s border.

    Declaration

    Swift

    @IBInspectable
    var cornerRadius: CGFloat { get set }
  • View’s border width.

    Declaration

    Swift

    @IBInspectable
    var borderWidth: CGFloat { get set }
  • View’s border color. It gets converted from UIColor to CGColor

    Declaration

    Swift

    @IBInspectable
    var borderColor: UIColor? { get set }
  • Rounds the given set of corners to the specified radius

    Declaration

    Swift

    func round(corners: UIRectCorner, radius: CGFloat)

    Parameters

    corners

    Corners to round

    radius

    Radius to round to

  • Rounds the given set of corners to the specified radius with a border

    Declaration

    Swift

    func round(corners: UIRectCorner, radius: CGFloat, borderColor: UIColor, borderWidth: CGFloat)

    Parameters

    corners

    Corners to round

    radius

    Radius to round to

    borderColor

    The border color

    borderWidth

    The border width

  • Fully rounds an autolayout view (e.g. one with no known frame) with the given diameter and border

    Declaration

    Swift

    func fullyRound(diameter: CGFloat, borderColor: UIColor, borderWidth: CGFloat)

    Parameters

    diameter

    The view’s diameter

    borderColor

    The border color

    borderWidth

    The border width