mirror of https://github.com/SnapKit/SnapKit
fa8d06355a | ||
---|---|---|
CodeSnippets | ||
SnapKit.xcodeproj | ||
SnapKit.xcworkspace | ||
Source | ||
Tests | ||
.gitignore | ||
.travis.yml | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
README.md | ||
SnapKit.podspec |
README.md
SnapKit is a DSL to make Auto Layout easy on both iOS and OS X.
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)
}
}
}
Resources
License
MIT license. See the LICENSE
file for details.