SnapKit

SnapKit

Language
Swift
Category
2
Version
5.6.0
Authors
Robert Payne
Description
Harness the power of auto layout with a simplified, chainable, and compile time safe syntax.
Install Instructions
  • Using CocoaPods is the easiest way. Modify your Podfile:
target 'MyApp' do
pod 'SnapKit', '~> 5.6'
end
  • Remember to go to your terminal, navigate to your project folder and run:
$ pod install
Usage
import SnapKit
class MyViewController: UIViewController {
lazy var box = UIView()
override func viewDidLoad() {
super.viewDidLoad()
self.view.addSubview(box)
box.snp.makeConstraints { (make) -> Void in
make.width.height.equalTo(50)
make.center.equalTo(self.view)
}
}
}
Links