UIView

public extension UIView

UIView Nib

  • nib

    Returns UIView UINib

    Declaration

    Swift

    var nib: UINib { get }

UIView Border

UIView Subviews

  • Get subviews

    Declaration

    Swift

    func subviews<T>(ofType type: T.Type) -> [T]
  • Removes all subviews in a view

    Declaration

    Swift

    func removeAllSubviews()

UIView Helper Properties

  • View’s Width Getter and Setter

    Declaration

    Swift

    var width: CGFloat { get set }
  • View’s Height Getter and Setter

    Declaration

    Swift

    var height: CGFloat { get set }
  • View’s Size Getter and Setter

    Declaration

    Swift

    var size: CGSize { get set }
  • View’s CenterX Getter and Setter

    Declaration

    Swift

    var centerX: CGFloat { get set }
  • View’s CenterY Getter and Setter

    Declaration

    Swift

    var centerY: CGFloat { get set }
  • View’s Left(minX) Getter and Setter

    Declaration

    Swift

    var left: CGFloat { get set }
  • top

    View’s Top(minY) Getter and Setter

    Declaration

    Swift

    var top: CGFloat { get set }
  • View’s Right(maxX) Getter and Setter

    Declaration

    Swift

    var right: CGFloat { get set }
  • View’s Bottom(maxY) Getter and Setter

    Declaration

    Swift

    var bottom: CGFloat { get set }
  • View’s Position Getter and Setter

    Declaration

    Swift

    var position: CGPoint { get set }
  • x

    View’s X Value Getter and Setter

    Declaration

    Swift

    var x: CGFloat { get set }
  • y

    View’s Y Value Getter and Setter

    Declaration

    Swift

    var y: CGFloat { get set }

Radius to UIView

  • Radius for any specifc corner

    Declaration

    Swift

    func roundCorners(corners: UIRectCorner, radius: CGFloat)

    Parameters

    corners

    Corner for radius

    radius

    Radius value

Animations

  • Shakes a view up-down

    Declaration

    Swift

    func shake()

Shadow

  • Adds shadow to view

    Declaration

    Swift

    func addShadow(shadowColor: UIColor, radius: CGFloat, opacity: Float)

    Parameters

    shadowColor

    Shadow Color

    radius

    Shadow Radius

    opacity

    Shadow Opacity

  • Adds Sketch Shadow to view

    Declaration

    Swift

    func addSketchShadow(color: UIColor = .black,
                         alpha: Float = 0.2,
                         x: CGFloat = 0,
                         y: CGFloat = 2,
                         blur: CGFloat = 4,
                         spread: CGFloat = 0)