mirror of https://github.com/SnapKit/SnapKit
updates
This commit is contained in:
parent
a231343050
commit
98298bb1ab
|
@ -18,12 +18,19 @@ class SimpleLayoutViewController: UIViewController {
|
||||||
return view
|
return view
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
let redView: UIView = {
|
||||||
|
let view = UIView()
|
||||||
|
view.backgroundColor = .redColor()
|
||||||
|
return view
|
||||||
|
}()
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
view.backgroundColor = UIColor.whiteColor()
|
view.backgroundColor = UIColor.whiteColor()
|
||||||
|
|
||||||
view.addSubview(blackView)
|
view.addSubview(blackView)
|
||||||
|
view.addSubview(redView)
|
||||||
|
|
||||||
view.setNeedsUpdateConstraints()
|
view.setNeedsUpdateConstraints()
|
||||||
}
|
}
|
||||||
|
@ -37,6 +44,11 @@ class SimpleLayoutViewController: UIViewController {
|
||||||
make.size.equalTo(CGSizeMake(100.0, 100.0))
|
make.size.equalTo(CGSizeMake(100.0, 100.0))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
redView.snp_makeConstraints(closure: { (make) -> Void in
|
||||||
|
make.top.equalTo(blackView.snp_bottom).offset(20.0)
|
||||||
|
make.size.equalTo(CGSizeMake(100.0, 100.0))
|
||||||
|
})
|
||||||
|
|
||||||
didSetupConstraints = true
|
didSetupConstraints = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue