14

I've got a universal project here with storyboard. I've created a subclass of UIWindow called MyWindow, and I need to load it instead of the default UIWindow. Prior to storyboard, I would simply go to the .XIB file in XCode and change the class for the main window to MyWindow. However, I'm unable to find any section where I can change this in storyboard.

Does anyone know where I can do this? I need the main window to load MyWindow, not UIWindow.

thebro
  • 305
  • 2
  • 11

1 Answers1

25

When using storyboards the application delegate and main window are no longer represented in Interface Builder. Instead, when your app starts, your app delegate is queried for a property called 'window'. If this returns nil then a default window of type UIWindow is created for you. To change this behaviour you need to implement a 'window' getter method in your app delegate that returns your 'MyWindow' subclass. See the documentation.

Robin Summerhill
  • 13,695
  • 3
  • 41
  • 37