ios - Programmatically adding two view controllers to two container views -
i have view controller has 2 containers. have view controllers each of these containers. these 3 view controllers in different story boards. how programmatically add 2 view controllers 2 containers?
at first need storyboards. in order should use uistoryboard class
uistoryboard *firststoryboard = [uistoryboard storyboardwithname: @"firststoryboardname" bundle: nil]; uistoryboard *secondstoryboard = [uistoryboard storyboardwithname: @"secondstoryboardname" bundle: nil]; uistoryboard *thirdstoryboard = [uistoryboard storyboardwithname: @"thirdstoryboardname" bundle: nil]; next need initial view controllers fro storyboards(assuming firststoryboard's view controller contains 2 containers)
uiviewcontroller *secondvc = (uiviewcontroller *)[secondstoryboard instantiateinitialviewcontroller]; uiviewcontroller *thirdvc = (uiviewcontroller *)[thirdstoryboard instantiateinitialviewcontroller]; now add these 2 view controllers containers in view controller contains containers
uiviewcontroller *firstvc = (uiviewcontroller *)[firststoryboard instantiateinitialviewcontroller]; // todo: add secondvc , thirdvc children of firstvc
Comments
Post a Comment