Unable to connect Xib to Storyboard-based view controller in Swift-based projects

Originator:jnjosh
Number:rdar://19916924 Date Originated:22-Feb-2015
Status:Open Resolved:
Product:iOS SDK Product Version:Xcode Version 6.3 (6D520o) - iOS 8.3 (12F5027d)
Classification:Other Bug Reproducible:Always
 
In Objective-C based projects, it is possible to connect a View Controller's Xib to the Storyboard by removing the View object from the Storyboard's representation of the View Controller. This works, presumably in conjunction with initWithNibName:bundle:'s default behavior, providing a Xib file of the same name as the class for the specific View Controller. It appears that this default behavior is not the same when using Swift. 

Two sample projects, one with Objective-C and the other with Swift, can be viewed here: https://github.com/jnjosh/RadarSamples/tree/master/StoryboardXib. The behavior consistently works in the Objective-C based project and doesn't in the Swift-based project.

Steps to Reproduce:
1. Create new Project with Storyboard with Swift
2. Create `SampleViewController` (subclass of UIViewController) and check the option to create Xib of same name.
3. In the Storyboard add a new View Controller as the Initial View controller.
4. Delete the View object in the View Controller's representation.
5. Change the class of the View Controller to `SampleViewController`


Expected Results:
When launching the app, the View should be sourced from the Xib file as there is no view in the Storyboard.


Actual Results:
No view is loaded from the Xib file.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!