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
cornersWhich corners like to apply
radiusAmount of radius
-
Fades in the view
Declaration
Swift
func fadeIn(duration: TimeInterval = 0.1)Parameters
durationAnimation duration Default:0.1
-
Fades out the view
Declaration
Swift
func fadeOut(duration: TimeInterval = 0.1)Parameters
durationAnimation 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
colorShadow Color
opacityOpacity (default: 0.5)
offsetOffset (default: 0:3)
radiusRadius (default: 3)
-
Locks the view for seconds
Declaration
Swift
func lock(for seconds: Double)Parameters
secondsSeconds
-
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
angleAngle
durationDuration (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
point0Starting point
point1Ending point
dotWidthLenght of each dot in the line (Default: 3)
gapWidthLength of each gap in the line (Default: 2)
lineWidthLine width (Default: 1)
colorColor of line (Default: .lightGray)
-
Adds indicator
Declaration
Swift
func addIndicator(style: UIActivityIndicatorView.Style = .gray)Parameters
styleStyle of indicator (Default: .gray)
-
Removes Indicator
Declaration
Swift
func removeIndicator() -
Undocumented
Declaration
Swift
func anchor() -> Anchor -
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 }
UIView Extension Reference