UIView

public extension UIView
  • Undocumented

    Declaration

    Swift

    @IBInspectable
    var cornerRadius: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    @IBInspectable
    var borderWidth: CGFloat { get set }
  • Undocumented

    Declaration

    Swift

    @IBInspectable
    var borderColor: UIColor? { get set }
  • Set spesific corners

    Declaration

    Swift

    func roundCorners(corners: UIRectCorner, radius: CGFloat)

    Parameters

    corners

    Which corners like to apply

    radius

    Amount of radius

  • Fades in the view

    Declaration

    Swift

    func fadeIn(duration: TimeInterval = 0.1)

    Parameters

    duration

    Animation duration Default:0.1

  • Fades out the view

    Declaration

    Swift

    func fadeOut(duration: TimeInterval = 0.1)

    Parameters

    duration

    Animation duration Default:0.1

  • Adds shadow

    Declaration

    Swift

    func addDropShadow(_ color: UIColor,
                       opacity: Float = 0.5,
                       offset: CGSize = CGSize(width: 0, height: 3),
                       radius: CGFloat = 3)

    Parameters

    color

    Shadow Color

    opacity

    Opacity (default: 0.5)

    offset

    Offset (default: 0:3)

    radius

    Radius (default: 3)

  • Locks the view for seconds

    Declaration

    Swift

    func lock(for seconds: Double)

    Parameters

    seconds

    Seconds

  • Locks the view for 0.3 seconds

    Declaration

    Swift

    func lockABit()
  • Rotate view with angle value

    Declaration

    Swift

    func rotate(_ angle: CGFloat, duration: TimeInterval = 0.3)

    Parameters

    angle

    Angle

    duration

    Duration (Default: 0.3)

  • Gets screenshot of view

    Declaration

    Swift

    func screenshot() -> UIImage?

    Return Value

    UIImage

  • Add dotted line

    Declaration

    Swift

    func addDottedLine(startAt point0: CGPoint,
                       endAt point1: CGPoint,
                       dotWidth: NSNumber = 3,
                       gapWidth: NSNumber = 2,
                       lineWidth: CGFloat = 1,
                       color: UIColor = .lightGray)

    Parameters

    point0

    Starting point

    point1

    Ending point

    dotWidth

    Lenght of each dot in the line (Default: 3)

    gapWidth

    Length of each gap in the line (Default: 2)

    lineWidth

    Line width (Default: 1)

    color

    Color of line (Default: .lightGray)

  • Adds indicator

    Declaration

    Swift

    func addIndicator(style: UIActivityIndicatorView.Style = .gray)

    Parameters

    style

    Style of indicator (Default: .gray)

  • Removes Indicator

    Declaration

    Swift

    func removeIndicator()
  • Undocumented

    Declaration

    Swift

    func anchor() -> Anchor
  • top

    Undocumented

    Declaration

    Swift

    var top: NSLayoutAnchor<NSLayoutYAxisAnchor> { get }
  • Undocumented

    Declaration

    Swift

    var left: NSLayoutAnchor<NSLayoutXAxisAnchor> { get }
  • Undocumented

    Declaration

    Swift

    var bottom: NSLayoutAnchor<NSLayoutYAxisAnchor> { get }
  • Undocumented

    Declaration

    Swift

    var right: NSLayoutAnchor<NSLayoutXAxisAnchor> { get }
  • Undocumented

    Declaration

    Swift

    var height: NSLayoutDimension { get }
  • Undocumented

    Declaration

    Swift

    var width: NSLayoutDimension { get }
  • Undocumented

    Declaration

    Swift

    var centerX: NSLayoutXAxisAnchor { get }
  • Undocumented

    Declaration

    Swift

    var centerY: NSLayoutYAxisAnchor { get }