     loginButtonWidthConstraint.constant = view.frame.width - 20 * 2
   }
   
-  
-  //MARK: IB actions
-  
+  //MARK: - IBActions
   @IBAction func startAnimationDidTap(sender: AnyObject) {
     animate()
   }
   
   @IBAction func loginDidTap(sender: AnyObject) {
     loginButton.addSubview(spinner)
-    spinner.frame.origin = CGPointMake(12, 12)
+    spinner.frame.origin = CGPoint(x: 12, y: 12)
     spinner.startAnimating()
     
     loginButtonTopMarginConstraint.constant = 120
     loginButtonWidthConstraint.constant -= 60
-    UIView.animateWithDuration(0.3, delay: 0.2, usingSpringWithDamping: 0.6, initialSpringVelocity: 0.5, options: [], animations: { () -> Void in
-      self.view.layoutIfNeeded()
-      }) { _ in
-        
+    UIView.animateWithDuration(0.3, delay: 0.2, usingSpringWithDamping: 0.6, initialSpringVelocity: 0.5, options: [],
+      animations: {
+        self.view.layoutIfNeeded()
+      }, completion: { _ in
         self.spinner.removeFromSuperview()
         self.loginButtonWidthConstraint.constant += 60
-        UIView.animateWithDuration(1.5, delay: 0, usingSpringWithDamping: 0.2, initialSpringVelocity: 0, options: [], animations: { () -> Void in
-          self.view.layoutIfNeeded()
-          }, completion: nil)
+        UIView.animateWithDuration(1.5, delay: 0, usingSpringWithDamping: 0.2, initialSpringVelocity: 0, options: [],
+          animations: {
+            self.view.layoutIfNeeded()
+          }, completion: nil
+        )
         
         UIView.transitionWithView(self.warningMessageView,
           duration: 0.3,
           options: [.TransitionFlipFromTop, .CurveEaseOut],
           animations: {
             self.warningMessageView.hidden = false
-          }, completion: nil)
-    }
+          }, completion: nil
+        )
+      }
+    )
   }
   
-  // MARK: Private methods
-  
-  func animate() {
-    UIView.animateWithDuration(0.3, delay: 0, usingSpringWithDamping: 0.4, initialSpringVelocity: 0, options: [], animations: {
-      for bubble in self.bubbleImageViewGroup1 {
-        bubble.transform = CGAffineTransformMakeScale(1, 1)
-      }
-    }, completion: nil)
+  // MARK: - Private methods
+  private func animate() {
+    UIView.animateWithDuration(0.3, delay: 0, usingSpringWithDamping: 0.4, initialSpringVelocity: 0, options: [],
+      animations: {
+        for bubble in self.bubbleImageViewGroup1 {
+          bubble.transform = CGAffineTransformIdentity
+        }
+      }, completion: nil
+    )
     
-    UIView.animateWithDuration(0.3, delay: 0.1, usingSpringWithDamping: 0.4, initialSpringVelocity: 0, options: [], animations: {
-      for bubble in self.bubbleImageViewGroup2 {
-        bubble.transform = CGAffineTransformMakeScale(1, 1)
-      }
-    }, completion: nil)
+    UIView.animateWithDuration(0.3, delay: 0.1, usingSpringWithDamping: 0.4, initialSpringVelocity: 0, options: [],
+      animations: {
+        for bubble in self.bubbleImageViewGroup2 {
+          bubble.transform = CGAffineTransformIdentity
+        }
+      }, completion: nil
+    )
     
     logoContraint.constant = centerConstraintEndConstant
-    UIView.animateWithDuration(0.3, delay: 0.2, usingSpringWithDamping: 0.6, initialSpringVelocity: 0.5, options: [], animations: {
+    UIView.animateWithDuration(0.3, delay: 0.2, usingSpringWithDamping: 0.6, initialSpringVelocity: 0.5, options: [],
+      animations: {
         self.view.layoutIfNeeded()
-    }, completion: nil)
+      }, completion: nil
+    )
     
     usernameConstraint.constant = centerConstraintEndConstant
-    UIView.animateWithDuration(0.3, delay: 0.3, usingSpringWithDamping: 0.6, initialSpringVelocity: 0.5, options: [], animations: {
-      self.view.layoutIfNeeded()
-    }, completion: nil)
+    UIView.animateWithDuration(0.3, delay: 0.3, usingSpringWithDamping: 0.6, initialSpringVelocity: 0.5, options: [],
+      animations: {
+        self.view.layoutIfNeeded()
+      }, completion: nil
+    )
     
     passwordConstraint.constant = centerConstraintEndConstant
-    UIView.animateWithDuration(0.3, delay: 0.4, usingSpringWithDamping: 0.6, initialSpringVelocity: 0.5, options: [], animations: {
-      self.view.layoutIfNeeded()
-    }, completion: nil)
+    UIView.animateWithDuration(0.3, delay: 0.4, usingSpringWithDamping: 0.6, initialSpringVelocity: 0.5, options: [],
+      animations: {
+        self.view.layoutIfNeeded()
+      }, completion: nil
+    )
     
     loginButtonConstraint.constant = centerConstraintEndConstant
-    UIView.animateWithDuration(0.3, delay: 0.5, usingSpringWithDamping: 0.6, initialSpringVelocity: 0.5, options: [], animations: {
-      self.view.layoutIfNeeded()
-    }, completion: nil)
+    UIView.animateWithDuration(0.3, delay: 0.5, usingSpringWithDamping: 0.6, initialSpringVelocity: 0.5, options: [],
+      animations: {
+        self.view.layoutIfNeeded()
+      }, completion: nil
+    )
   }
 }

class AutoLayoutLoginViewController: UIViewController {
  
  //MARK: IB outlets
  
  @IBOutlet var bubbleImageViewGroup1: [UIImageView]!
  @IBOutlet var bubbleImageViewGroup2: [UIImageView]!
  @IBOutlet var usernameTextField: UITextField!

    }
    
    // Setup username and password textfields
    let paddingViewForUsername = UIView(frame: CGRect(x: 0, y: 0, width: 44, height: usernameTextField.frame.height))
    usernameTextField.leftView = paddingViewForUsername
    usernameTextField.leftViewMode = .Always
    
