         }
         
         if self.pageViewControllers.objectAtIndex(index).isEqual(NSNull()) {
-            var vc: UIViewController? = nil
-            var view: UIView? = nil
-            
-            vc = self.datasource?.viewControllerForPageAtIndex?(self, index: index)
-            
-            if vc == nil {
-                vc = UIViewController()
-                view = self.datasource?.viewForPageAtIndex?(self, index: index)
-                
-                if view == nil {
-                    view = UIView()
-                }
-                
-                vc?.view = UIView()
-                vc?.view.addSubview(view!)
-            }
-            
-            view = vc?.view.subviews[0] as? UIView
-            
-            if view? is UIScrollView {
+            let vc: UIViewController? = self.datasource?.viewControllerForPageAtIndex?(self, index: index)
+            let view: UIView = vc?.view.subviews[0] as UIView
+            
+            if view is UIScrollView {
                 var edgeInsets: UIEdgeInsets = (view as UIScrollView).contentInset
                 
                 if self.tabbarPosition == UIBarPosition.Top || self.tabbarPosition == UIBarPosition.TopAttached {

    var indicatorHeight: CGFloat = 2.0
    var indicatorColor: UIColor = UIColor.lightGrayColor()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.initSelf()
    }


                tabWidth = self.delegate!.widthForTabAtIndex!(index)
            }
            
            let tabView: RGTabView = RGTabView(frame: CGRectMake(0.0, 0.0, tabWidth, self.tabHeight), color: self.tabIndicatorColor)
            
            tabView.addSubview(tabViewContent!)
            tabView.clipsToBounds = true
