         for pageView in containerScrollView.subviews {
             pageView.removeFromSuperview()
         }
-        
-        for var i = 0; i < self.viewControllers?.count; i++ {
+      
+        for i in (0..<self.viewControllers!.count) {
             let page = self.viewControllers?[i]
             self.addChildViewController(page!)
             let nextFrame:CGRect = CGRectMake(CGFloat(i) * self.view.bounds.size.width, self.view.frame.origin.y, self.view.frame.size.width, self.view.frame.size.height)

        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
    }
    
    required init(coder: NSCoder) {
        super.init(coder: coder)
    }
    

    }
    
    override func viewDidLayoutSubviews() {
        for i in (0..<self.viewControllers!.count) {
            let pageX:CGFloat = CGFloat(i) * self.view.bounds.size.width
            self.viewControllers?[i].view.frame = CGRectMake(pageX, 0.0, self.view.bounds.size.width, self.view.bounds.size.height)
        }
