   class func moveConstraints(fromView: UIView, toView: UIView) {
     let constraints = fromView.constraints()
     for constraint in constraints {
-      if let currentConstraint = constraint as? NSLayoutConstraint {
-        moveConstraint(currentConstraint, fromView: fromView, toView: toView)
+      if let constraint = constraint as? NSLayoutConstraint {
+        moveConstraint(constraint, fromView: fromView, toView: toView)
       }
     }
   }

    
    // Move all subviews to newSuperview
    for subview in fromView.subviews {
      if let currentSubview = subview as? UIView {
        if currentSubview == newSuperview { continue }
        newSuperview.addSubview(currentSubview)
      }
    }
    

  private class func moveConstraint(constraint: NSLayoutConstraint,
    fromView: UIView, toView: UIView) {
      
      if let firstItem = constraint.firstItem as? NSObject {
        
        let newFirstItem = firstItem == fromView ? toView : firstItem
        
        if let secondItem = constraint.secondItem as? NSObject {
          let newSecondItem = secondItem == fromView ? toView : secondItem
          
          let newConstraint = NSLayoutConstraint(
            item: newFirstItem,
