The control on the UIView uses the push method to jump to, uiviewpush

Source: Internet
Author: User

The control on the UIView uses the push method to jump to, uiviewpush

Sometimes in a project, in order to ensure the consistency of the forward and backward page Jump methods, the control on the UIview will jump to another Controller. Therefore, this method is required at this time. Of course, the present method can achieve redirection, but the style may be different. At this time, I can use a proxy or callback in my thoughts. When you are not familiar with it, I used this method:

1. Reference others' Methods: http://gekie.iteye.com/blog/1133460

2. Use the method of the responder chain...

1> assume that your project contains the file UIViewContronllerA, UIViewContronllerB, and UIView. Our UIview is a view encapsulated in UIViewContronllerA, and, we need to jump to UIViewContronllerB through an event on UIview (the jump method is on the UIview page)

2> first, we declare an attribute @ property (nonatomic, strong) UIViewController * owner on the UIView. h page;

Then, call the Redirect method in the event to be redirected on the UIView. m page: [self. owner. navigationController pushViewController: [UIViewContronller2 new] animated: YES];

3> finally, do not forget to call this UIVIew in the UIViewContronllerA controller:

UIView * view = [[UIView alloc] init];

View. owner = self;

OK! In this way, you can jump to the view above ....

Related Article

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.