Question

Since there seems to be no window settings in UIStoryboard editor, I want to know how to switch the AppDelegate's window class from UIWindow to its subclass.

What I often do is writing the following codes in application:didFinishLaunchingWithOptions:, but each time it really makes me dull.

UIViewController* vc = self.window.rootViewController;
self.window = [[MyWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = vc;

Any ideas?

Was it helpful?

Solution

You are doing the right thing. That is the way to customize your window. Setting it in IB is just as cumbersome, if you think about it.

If you are dulled by the prospect of typing these three lines of code, consider the convenient feature of the Code Snippets Library in Xcode.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top