From 6f5b8c4e55f0b582958f507798d6e0a9b87c452d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elvis=20Nu=C3=B1ez?= <3lvis@users.noreply.github.com> Date: Thu, 12 May 2016 10:55:55 +0200 Subject: [PATCH] Remove unneeded closure ornamentation --- .../demos/SimpleLayoutViewController.swift | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Example-iOS/demos/SimpleLayoutViewController.swift b/Example-iOS/demos/SimpleLayoutViewController.swift index 414d0d6..cb0d348 100644 --- a/Example-iOS/demos/SimpleLayoutViewController.swift +++ b/Example-iOS/demos/SimpleLayoutViewController.swift @@ -11,87 +11,87 @@ import UIKit class SimpleLayoutViewController: UIViewController { var didSetupConstraints = false - + let blackView: UIView = { let view = UIView() view.backgroundColor = .blackColor() return view }() - + let redView: UIView = { let view = UIView() view.backgroundColor = .redColor() return view }() - + let yellowView: UIView = { let view = UIView() view.backgroundColor = .yellowColor() return view }() - + let blueView: UIView = { let view = UIView() view.backgroundColor = .blueColor() return view }() - + let greenView: UIView = { let view = UIView() view.backgroundColor = .greenColor() return view }() - + override func viewDidLoad() { super.viewDidLoad() - + view.backgroundColor = UIColor.whiteColor() - + view.addSubview(blackView) view.addSubview(redView) view.addSubview(yellowView) view.addSubview(blueView) view.addSubview(greenView) - + view.setNeedsUpdateConstraints() } override func updateViewConstraints() { - + if (!didSetupConstraints) { - - blackView.snp_makeConstraints(closure: { (make) -> Void in + + blackView.snp_makeConstraints { make in make.center.equalTo(view) make.size.equalTo(CGSizeMake(100.0, 100.0)) - }) - - redView.snp_makeConstraints(closure: { (make) -> Void in + } + + redView.snp_makeConstraints { make in make.top.equalTo(blackView.snp_bottom).offset(20.0) make.left.equalTo(20.0) make.size.equalTo(CGSizeMake(100.0, 100.0)) - }) - - yellowView.snp_makeConstraints(closure: { (make) -> Void in + } + + yellowView.snp_makeConstraints { make in make.top.equalTo(blackView.snp_bottom).offset(20.0) make.left.equalTo(blackView.snp_right).offset(20.0) make.size.equalTo(CGSizeMake(100.0, 100.0)) - }) - - blueView.snp_makeConstraints(closure: { (make) -> Void in + } + + blueView.snp_makeConstraints { make in make.bottom.equalTo(blackView.snp_top).offset(-20.0) make.left.equalTo(blackView.snp_right).offset(20.0) make.size.equalTo(CGSizeMake(100.0, 100.0)) - }) - - greenView.snp_makeConstraints(closure: { (make) -> Void in + } + + greenView.snp_makeConstraints { make in make.bottom.equalTo(blackView.snp_top).offset(-20.0) make.right.equalTo(blackView.snp_left).offset(-20.0) make.size.equalTo(CGSizeMake(100.0, 100.0)) - }) - + } + didSetupConstraints = true } - + super.updateViewConstraints() }