添加子VIewcontroller

需要同时将视图控制器和对应的view
加载到当前视图控制器上
      SecondController   *second = [[ SecondController   alloc ] init ];
    second. view . frame   =   CGRectMake ( 20 ,   20 ,   self . view . bounds . size . width - 40 ,   self . view . bounds . size . height - 40 );
    [ self   addChildViewController :second];
    [ self . view   addSubview :second. view ];

你可能感兴趣的:(子ViewController)