Access Container View Controller from Parent iOS

后端 未结 11 2220
遥遥无期
遥遥无期 2020-11-28 18:13

in iOS6 I noticed the new Container View but am not quite sure how to access it\'s controller from the containing view.

Scenario:

11条回答
  •  死守一世寂寞
    2020-11-28 18:31

    you can write like this

    - (IBAction)showDetail:(UIButton *)sender {  
                DetailViewController *detailVc = [self.childViewControllers firstObject];  
            detailVc.lable.text = sender.titleLabel.text;  
        }  
    }
    

提交回复
热议问题