Cannot set Custom Class in Workspace with two projects with same-named class with different parent classes

Originator:jordanbondo
Number:rdar://28756473 Date Originated:13-Oct-2016
Status:Duplicate - 9332613 (Open) Resolved:
Product:Developer Tools Product Version:Xcode 8 (8A218a)
Classification:Bug Reproducible:Always
 
Summary:
If you have a workspace with multiple projects (ex. iOS & tvOS), Interface Builder will not let you set a custom class in one project where a class with the same name, but different parent class, exists in the other project, even though the classes are not in the same project or apart of the same target.

If you open the individual project files, you are able to set the custom class as expected. However, when you open the Workspace again and click the arrow in the "Class" field in the Identity Inspector, you are always taken to the same class.

Example:
I have created a sample project where I have an iOS project that uses Objective-C and a tvOS project that uses Swift. The iOS project uses a UIViewController, named ViewController, as it's custom class for the root view. The tvOS project has a UITabBarController, also named ViewController, as it's custom class for the root view. In the storyboard for the iOS project, I am able to select "ViewController" for the "Custom Class". In the storyboard for the tvOS project, I am NOT able to select "ViewController" for the "Custom Class". If I open the tvOS project on it's own (not using the Workspace), I am then able to select "ViewController" for the "Custom Class" and everything works as expected. I now go back to the Workspace and open the storyboard for the tvOS project, "ViewController" IS still selected for the "Custom Class", however; selecting the arrow icon in the "Class" field that is supposed to open the class file in the Editor window, ViewController.h is opened, instead of ViewController.swift.

Steps to Reproduce:
See attached sample project. The example has already been configured as described in the steps below - all you need to do is attempt to set the Custom Class for the Tab Bar Controller in the tvOS project storyboard.

You may also perform the following steps to reproduce separately:
Part 1
1. Create a Workspace
2. Create an iOS project that uses Objective-C and add it to the workspace
3. Add UIViewController subclass to the iOS project and name it "ViewController".
4. Add a "View Controller" object to the iOS project's storyboard
5. Set "ViewController" as the Custom Class for the storyboard's UIViewController scene
6. Create a tvOS project that uses Swift and add it to the workspace
7. Add a UITabBarController subclass to the tvOS project and name it "ViewController"
8. Add a "Tab Bar Controller" to the tvOS project's storyboard
9. Click the drop-down in the "Class" field in the "Custom Class" section of the Identity Inspector
10. "ViewController" is not visible as an option.

Part 2:
11. Close the workspace and open the tvOS project on its own
12. Open the tvOS project's storyboard and select the "Tab Bar Controller" scene added earlier
13. Click the drop-down in the "Class" field in the "Custom Class" section of the Identity Inspector
14. You are now able to select "View Controller" as the custom class
15. Close the tvOS project
16. Open the Workspace again
17. Open the tvOS project's storyboard
18. Select the "Tab Bar Controller" scene - "ViewController" is still selected as the Custom Class
19. Click the arrow icon in the "Class" field in the "Custom Class" section of the Identity Inspector

Expected Results:
Part 1:
I expect to be able set a custom view controller to any class I have in the project that the storyboard belongs to.

Part 2:
I expect to be taken to the actual custom class for the project the storyboard belongs to

Actual Results:
Part 1:
I am not able to set a custom class for an objects of different types

Part 2:
Selecting the arrow icon in the tvOS project takes me to the custom class file in the iOS project.

Version:
Xcode 8 (8A218a)

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!