"ios" iOS it container view get Viewcontroller

Source: Internet
Author: User

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.

    1. Click Segue, set Identifier
    2. 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

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.