Ver Fonte

updates

Spiros Gerokostas há 9 anos atrás
pai
commit
98298bb1ab
1 ficheiros alterados com 12 adições e 0 exclusões
  1. 12 0
      Example-iOS/demos/SimpleLayoutViewController.swift

+ 12 - 0
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
         }