2015-04-16 20:47:03 +08:00
|
|
|
<img src="http://snapkit.io/images/banner.png" alt="" />
|
2015-04-12 18:36:02 +08:00
|
|
|
|
2015-04-16 20:47:03 +08:00
|
|
|
SnapKit is a DSL to make Auto Layout easy on both iOS and OS X.
|
2014-07-29 08:39:59 +08:00
|
|
|
|
2015-04-15 19:07:50 +08:00
|
|
|
[![Build Status](https://travis-ci.org/SnapKit/SnapKit.svg)](https://travis-ci.org/SnapKit/SnapKit)
|
2015-03-24 06:45:35 +08:00
|
|
|
|
2015-04-26 18:12:25 +08:00
|
|
|
> SnapKit does build just fine, Travis.ci doesn't support Swift 1.2 yet so this will show as failing until it is supported.
|
2015-04-26 18:12:01 +08:00
|
|
|
|
2014-07-29 08:39:59 +08:00
|
|
|
```swift
|
2015-04-16 20:47:03 +08:00
|
|
|
import SnapKit
|
2014-07-29 08:39:59 +08:00
|
|
|
|
2015-04-16 20:47:03 +08:00
|
|
|
class MyViewController: UIViewController {
|
2014-07-29 08:39:59 +08:00
|
|
|
|
2015-04-16 20:47:03 +08:00
|
|
|
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)
|
|
|
|
}
|
2014-07-29 08:39:59 +08:00
|
|
|
}
|
2015-04-16 20:47:03 +08:00
|
|
|
|
2014-07-29 08:39:59 +08:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2015-04-16 20:47:03 +08:00
|
|
|
## Resources
|
2014-12-05 09:36:41 +08:00
|
|
|
|
2015-04-16 20:47:03 +08:00
|
|
|
* [Documentation](http://snapkit.io/docs/)
|
|
|
|
* [F.A.Q.](http://snapkit.io/faq/)
|
2014-12-05 09:36:41 +08:00
|
|
|
|
2015-04-16 20:47:03 +08:00
|
|
|
## License
|
2014-07-29 08:39:59 +08:00
|
|
|
|
2015-04-16 20:47:03 +08:00
|
|
|
MIT license. See the `LICENSE` file for details.
|