Go to file
Akiva Leffert cd49354220 Factor redundant constraint relation code into RelationTarget protocol
Instead of having a copy of each method for each type, factor the
constraint target logic to use a new protocol RelationTarget.

Note that since RelationTarget returns a new ConstraintItem and the
constructor for ConstraintItem is internal, a user will be unable to
erroneously extend the protocol.

LayoutSupport should really be a RelationTarget too, but it seems you
can't extenda a protocol to implement another protocol.
2015-10-14 20:17:59 -04:00
CodeSnippets Snap is now SnapKit 2015-04-15 23:07:50 +12:00
SnapKit.xcodeproj Updated for Swift 2.0 2015-07-30 19:30:56 +12:00
SnapKit.xcworkspace Snap is now SnapKit 2015-04-15 23:07:50 +12:00
Source Factor redundant constraint relation code into RelationTarget protocol 2015-10-14 20:17:59 -04:00
Tests Added tvOS checks so the iOS paths are used rather than OS X 2015-09-24 21:37:33 -07:00
.gitignore Updated gitignore 2015-04-12 22:38:56 +12:00
.travis.yml Update Travis.ci 2015-09-13 01:13:13 +12:00
CHANGELOG.md Updated changelog 2015-09-22 20:07:08 +12:00
CONTRIBUTING.md Added contributing document 2015-09-29 21:27:03 +13:00
LICENSE Snap is now SnapKit 2015-04-15 23:07:50 +12:00
README.md Updated readme 2015-09-22 19:57:29 +12:00
SnapKit.podspec Prepare for release 2015-09-22 20:02:01 +12:00

README.md

SnapKit is a DSL to make Auto Layout easy on both iOS and OS X.

Build Status Cocoapods Compatible Carthage compatible

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.