To run the example project, clone the repo, and run pod install
from the Example directory first.
Chain is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Chain'
- 代码
class ViewController: UIViewController {
let myView = UIView()
.cp
.backgroundColor(.red)
.frame(.init(x: 100, y: 100, width: 100, height: 100))
.end
override func viewDidLoad() {
super.viewDidLoad()
myView.layer.cp
.cornerRadius(15)
view.addSubview(myView)
}
}
- 效果
Chain is available under the MIT license. See the LICENSE file for more info.