IOS programming-UIWindow switching and iosuiwindow Switching
Because a custom bottom pop-up window effect needs to be created in the recent project, I studied UIActionSheet and planned to rewrite a custom pop-up window. I was lazy when I wrote the demo, directly in
-(Void) viewDidLoad {}
The window switch test code is written, and the following error message is displayed during debugging:
Terminating app due to uncaught exception 'nsinternalinconsistencyexception', reason: 'application windows are expected to have a root view controller at the end of Application launch'
I searched the internet and most of my friends said it was caused by the Xcode version.
-(BOOL) application :( UIApplication *) application didfinishlaunchingwitexceptions :( NSDictionary *) launchOptions {}
Method to manually add a rootViewController. After the above method is done, the same BUG is still reported. Then, click the event button to write the window switching code, and click the event to trigger the switch. This method solves this problem.
Initial Cause Analysis:
It may be that the page is not drawn during viewDidLoad, But switching the window at this time leads to this exception error, which is only a one-sided guess, if you want to know something, I hope you can correct it.
Custom action sheet GIT link: https://github.com/SuPair/SUActionSheet