     let scrollView: UIScrollView = {
         let scrollView = UIScrollView()
         
-        scrollView.setTranslatesAutoresizingMaskIntoConstraints(false)
+        scrollView.translatesAutoresizingMaskIntoConstraints = false
         scrollView.showsHorizontalScrollIndicator = false
         scrollView.showsVerticalScrollIndicator = false
         scrollView.pagingEnabled = true

     */
    private func updateViewControllers() {
        
        if scrollView.bounds == CGRect.zeroRect {
            return
        }
        
        scrollView.removeConstraints(scrollView.constraints())
        (scrollView.subviews as! [UIView]).map { $0.removeFromSuperview() }
        
        let metrics = ["w": scrollView.bounds.width, "h": scrollView.bounds.height]
        

            let viewController = controllers[viewControllerIndex]
            let view = viewController.view
            
            view.translatesAutoresizingMaskIntoConstraints = false
            view.removeHeightWidthConstraints()
            scrollView.addSubview(view)
            
            let viewsDictionary = ["view": view]
            
            //  define height and width
            view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[view(h)]", options: [], metrics: metrics, views: viewsDictionary))
            view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:[view(w)]", options: [], metrics: metrics, views: viewsDictionary))
            
            //  define scroll view content size vertically
            scrollView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|[view]|", options: [], metrics: nil, views: viewsDictionary))
            
            //  position first view at beginning of scroll view
            if viewControllerIndex == 0 {
                scrollView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[view]", options: [], metrics: nil, views: viewsDictionary))
            } else {
                //  position subsequent views after the previous view
                let previousViewController = controllers[viewControllerIndex - 1]
                let previousView = previousViewController.view
                
                scrollView.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:[previousView][view]", options: [], metrics: nil, views: ["previousView": previousView, "view": view]))
                
                //  if we added the 'final constraints' before, we remove them
                if let finalConstraints = lastViewConstraints {
                    scrollView.removeConstraints(finalConstraints)
                }
                
                lastViewConstraints = NSLayoutConstraint.constraintsWithVisualFormat("H:[view]|", options: [], metrics: nil, views: viewsDictionary)
                scrollView.addConstraints(lastViewConstraints!)
            }
        }
        
