1. 程式人生 > >iOS將一個viewcontroller的view加到self.view上

iOS將一個viewcontroller的view加到self.view上

        UIViewController *vc = [[UIViewController alloc] init];
        [self addChildViewController:vc];
        vc.view.frame = self.view.bounds;
        [self.view addSubview:vc.view];
        [vc didMoveToParentViewController:self];