I'm writing an iOS 8 App Extension (widget) for the Today view. The default template in xcode comes with a storyboard. How can I use an xib file instead of an storyboard?
The documentation says this is possible, but I can't seem to figure out how to change the info.plist file to get the xib loaded.
all you need to do is add "NSExtensionPrincipalClass" and the classname which you want.
As I recently discovered the hard way - notice that the 'NSExtensionPrincipalClass' must be directly under the 'NSExtension' key. e.g class ShareViewController
:
<key>NSExtension</key>
<dict>
<key>NSExtensionPrincipalClass</key>
<string>ShareViewController</string>
...
</dict>
By default, the Today template supplies the following Info.plist keys and values (shown here for an OS X target):
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.widget-extension</string>
<key>NSExtensionPrincipalClass</key>
<string>TodayViewController</string>
</dict>
If you use a custom view controller subclass, use the custom class name to replace the TodayViewController value for the NSExtensionPrincipalClass key.
iOS. If you don’t want to use the storyboard file provided by the template, remove the NSExtensionMainStoryboard key and add the NSExtensionPrincipalClass key, using the name of your view controller for the value.
Most of the work you do to create a Today widget involves designing the UI and implementing a view controller subclass that performs your custom functionality.
BY APPLE GUIDELINES:-->click to view