-
since: 0.3
-
description: Sets a background to your view (color, gradient and or image)
-
applies:
UIView
-
usage:
style.background = UIColor.redColor() style.background = Background(UIImage(named: "bg"), UIColor.orangeGradient())
## Border
- __**since**__: 0.1
- __**description**__: Sets view border color and width
- __**applies**__: `UIView`
- __**usage**__:
```swift
// until 0.7
style.border = Border(width: 1, color: UIColor.blueColor())
// after 0.7 you can define one or all borders
style.border = Border(all: (width: 1, color: UIColor.blue))
style.border = Border(.left, style: (width: 1, color: UIColor.blue))
style.border = Border([.left, .right] : (width: 1, color: UIColor.blue))
```
## Clip
- __**since**__: 0.4
- __**description**__: enables/disables view overflow clipping
- __**applies**__: `UIView`
- __**default**__: false
- __**usage**__:
```swift
style.clip = true
- since: 0.1
- description: Sets text color
- applies:
UILabel
- usage:
style.color = UIColor.redColor()
- since: 0.4
- description: Sets view corner radius
- applies:
UIView
- usage:
style.corners = Corners(radius: 4)
- since: 0.1
- description: Sets text font
- applies:
UILabel
- usage:
style.font = UIFont.systemFontOfSize(15)
- since: 0.7
- description: Sets a view height using AutoLayout.
- applies:
UIView
- usage:
style.height = 42
style.height = 50 ~ UILayoutPriorityDefaultHigh
- since: 0.6
- description: Sets a view internal margin/padding, i.e.
UIView.layoutMargins
orUIButton.contentEdgeInsets
. - applies:
UIView
,UIButton
- usage:
style.margin = UIEdgeInsetsMake(4, 4, 2, 2)
/// sets UIView.layoutMargins
/// or UIButton.contentEdgeInsets
- since: 0.7
- description: Sets a view maximum height using AutoLayout.
- applies:
UIView
- usage:
style.maxHeight = 42
style.maxHeight = 50 ~ UILayoutPriorityDefaultHigh
- since: 0.7
- description: Sets a view maximum width using AutoLayout.
- applies:
UIView
- see: maxHeight
- since: 0.7
- description: Sets a view minimum height using AutoLayout.
- applies:
UIView
- usage:
style.minHeight = 42
style.minHeight = 50 ~ UILayoutPriorityDefaultHigh
- since: 0.7
- description: Sets a view minimum width using AutoLayout.
- applies:
UIView
- see: minHeight
- since: 0.4
- description: Changes view alpha.
- applies:
UIView
- range: 0 (tranparent) ... 100 (opaque)
- usage:
style.opacity = 80
-
since: xxx
-
description: Applies shadow to view.
-
applies:
UIView
-
usage:
style.shadow = NSShadow(offset: CGSize(width: 0, height: 0), radius: 4, color: UIColor.red)
- since: 0.1
- description: Sets whether or not the view is visible by changing
hidden
property. - applies:
UIView
- default: true
- usage:
style.visible = false
- since: 0.7
- description: Sets a view width using AutoLayout.
- applies:
UIView
- see: height