From 98298bb1abec654a5fa8d942f90329f3cfdf5960 Mon Sep 17 00:00:00 2001 From: Spiros Gerokostas Date: Tue, 1 Mar 2016 13:16:44 +0200 Subject: [PATCH] updates --- Example-iOS/demos/SimpleLayoutViewController.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Example-iOS/demos/SimpleLayoutViewController.swift b/Example-iOS/demos/SimpleLayoutViewController.swift index d30f2a0..f5b0096 100644 --- a/Example-iOS/demos/SimpleLayoutViewController.swift +++ b/Example-iOS/demos/SimpleLayoutViewController.swift @@ -18,12 +18,19 @@ class SimpleLayoutViewController: UIViewController { return view }() + let redView: UIView = { + let view = UIView() + view.backgroundColor = .redColor() + return view + }() + override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = UIColor.whiteColor() view.addSubview(blackView) + view.addSubview(redView) view.setNeedsUpdateConstraints() } @@ -37,6 +44,11 @@ class SimpleLayoutViewController: UIViewController { 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 }