mirror of https://github.com/SnapKit/SnapKit
f03dd0e85f
# Conflicts: # .travis.yml # CHANGELOG.md # README.md # SnapKit.podspec # SnapKit.xcodeproj/project.pbxproj # SnapKit.xcodeproj/xcshareddata/xcschemes/SnapKit OSX.xcscheme # SnapKit.xcodeproj/xcshareddata/xcschemes/SnapKit iOS.xcscheme # Source/Constraint.swift # Source/ConstraintAttributes.swift # Source/ConstraintDescription.swift # Source/ConstraintMaker.swift # Source/ConstraintView.swift # Source/Debugging.swift # Source/LayoutConstraint.swift # Source/View+SnapKit.swift # Tests/Tests.swift |
||
---|---|---|
CodeSnippets | ||
Example-iOS | ||
SnapKit.xcodeproj | ||
SnapKit.xcworkspace | ||
Source | ||
Tests | ||
.gitignore | ||
.travis.yml | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
ISSUE_TEMPLATE.md | ||
LICENSE | ||
Package.swift | ||
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.