1
viewControllerにChildViewControllerがあるときに何かしたいです。今iOS Check ViewControllerにChildViewControllerがありますか?
ParentVC *parentVC = [self.storyboard instantiateViewControllerWithIdentifier:@"IDParentVC"];
ChildVC *childVC = [self.storyboard instantiateViewControllerWithIdentifier:@"IDChildVC"];
[childVC.view setFrame:CGRectMake(0,self.view.frame.size.height, self.view.frame.size.width, self.view.frame.size.height)];
[parentVC addChildViewController:childVC];
[parentVC.view addSubview:childVC.view];
[childVC didMoveToParentViewController:parentVC];
をどのようにParentVCがChildVCがあることを持っているかどうかを確認するために:
私は子供のViewControllerを追加するためのコードの下に使用していますか?
は 'UIViewController'クラスを使用すると、列挙することができます' childViewControllers'性を有している希望