Recently, container view was used to establish its own child controller in the main view controller, but encountered a problem. I don't know how to get the view controller that comes with controller view in code.
I wanted to get the view Controller that came with it and set up the agent inside. Then the main view controller to implement the proxy method, found a lot of information, the solution such as the following.
Set up an. h and. m file to associate the view Controller that came with the container view, setting the proxy inside.
- Click Segue, set Identifier
- Inheriting methods in the main view controller
-(void) Prepareforsegue: (Uistoryboardsegue *) Segue Sender: (ID) sender
implementing the following code is possible.
This allows the controller of the view controller to jump to the segue, so the agent can set it to call the other party.
Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.
iOS iOS It container view get Viewcontroller