     {
         super.viewDidLoad()
 
-        let bar:VBar = VBar(parent:self)
-        self.bar = bar
-        view.addSubview(bar)
-        
         let home:CHome = CHome()
         current = home
         addChildViewController(home)
-        view.addSubview(home.view)
+        viewParent.center(home)
         home.didMoveToParentViewController(self)
-        
-        let views:[String:AnyObject] = [
-            "home":home.view,
-            "bar":bar]
-        
-        let metrics:[String:AnyObject] = [
-            "barHeight":kBarHeight]
-        
-        view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat(
-            "H:|-0-[bar]-0-|",
-            options:[],
-            metrics:metrics,
-            views:views))
-        view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat(
-            "V:|-0-[bar(barHeight)]-0-[home]-0-|",
-            options:[],
-            metrics:metrics,
-            views:views))
-        
-        layoutCurrentLeft = NSLayoutConstraint(
-            item:home.view,
-            attribute:NSLayoutAttribute.Left,
-            relatedBy:NSLayoutRelation.Equal,
-            toItem:view,
-            attribute:NSLayoutAttribute.Left,
-            multiplier:1,
-            constant:0)
-        layoutCurrentRight = NSLayoutConstraint(
-            item:home.view,
-            attribute:NSLayoutAttribute.Right,
-            relatedBy:NSLayoutRelation.Equal,
-            toItem:view,
-            attribute:NSLayoutAttribute.Right,
-            multiplier:1,
-            constant:0)
-        
-        view.addConstraint(layoutCurrentLeft)
-        view.addConstraint(layoutCurrentRight)
     }
     
     override func loadView()

    
    func scrollLeft(controller:UIViewController)
    {
        let width:CGFloat = view.bounds.maxX
        addChildViewController(controller)
        view.addSubview(controller.view)
        
        UIView.animateWithDuration(
            kAnimationDuration,
            animations:
            {
                
            })
        { (done) in
            
        }
        
        home.didMoveToParentViewController(self)
        
    }
    
    func scrollRight(controller:UIViewController)
    {
        
    }
}
class CParent:UIViewController
{
    weak var viewParent:VParent!
    weak var current:UIViewController?
    let kBarHeight:CGFloat = 64
    let kBarMinHeight:CGFloat = 20
    private var statusBarStyle:UIStatusBarStyle = UIStatusBarStyle.LightContent
