Get ViewController from iOS Container View

Source: Internet
Author: User

Recently, Container View was used to create its own sub-Controller in the main View Controller. However, if you encounter problems, you do not know how to use the code to obtain the View Controller attached to the Controller View.

I wanted to get the View Controller attached to it, set the proxy in it, and then implement the modern management method in the main View Controller. I found a lot of information. The solution is as follows.

Create a. h and. m file, associate it with the view Controller attached to the Container View, and set the proxy in it.

Click Segue to set the Identifier Inheritance Method in the main View Controller.

-(Void) prepareForSegue :( UIStoryboardSegue *) segue sender :( id) sender
Implement the following code.


In this way, you can get the Controller of the View Controller to jump to the segue, 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.