iOS container view get Viewcontroller

Source: Internet
Author: User

recently using Container view to create your own child controller in the main view controller, but encountered a problem, do not know how to use the code to get the view included with the controller view Controller.

I want to get the view controller that comes with it, set the agent in the inside, then implement the proxy method in the main view controller, find a lot of information, the solution is as follows.

Set up an. h and. m file to associate the view Controller that came with the container view, setting the proxy inside.

    1. Click Segue, set Identifier
    2. Inheriting methods in the main view controller

-(void) Prepareforsegue: (Uistoryboardsegue *) Segue Sender: (ID) sender
implement the following code.


This allows you to get the controller of the view controller that segue jumps to, and then set the proxy for it to call each other.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.