PresentViewController:animated:completion: The Special place

Source: Internet
Author: User

Prototype:

-(void) Presentviewcontroller: (Uiviewcontroller *) viewcontrollertopresent animated: (BOOL) flag completion: (void (^) ( void)) Completion


Describe:

Presents a view controller modally.
In a horizontally compact environment, the presented view are always full screens. In a horizontally regular environment, the presentation depends on the value of the Modalpresentationstyle property.
This method sets the Presentedviewcontroller property to the specified view controller, resizes that view controller '?? s view based on the presentation style and then adds the view to the view hierarchy. The view is animated onscreen according to the transition style specified in the Modaltransitionstyle property of the Pres ented View Controller.
The completion handler is called after the Viewdidappear:method are called on the presented view Controller.

Notice where the red text is above.

In general, page jumps must be done after Viewdidload and viewdidappear, if you are jumping in presentViewController:animated:completion: completion, You can make sure that the page jumps after viewdidappear. Otherwise, it is possible to prompt warning:attempt to present on whose view are not in the window hierarchy!


Reference:

Solution for Warning:attempt to present on whose view are not in the window hierarchy!


PresentViewController:animated:completion: The Special place

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.