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