Setting a custom subclass in Interface Builder should warn if the subclass is not reachable by the storyboard's/xib's main target
| Originator: | ryan | ||
| Number: | rdar://24011422 | Date Originated: | 26-Dec-2015 01:39 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | 7.2 |
| Classification: | UI/Usability | Reproducible: | Always |
Summary: When setting a custom subclass for a UI component in Interface Builder, the IB interface allows the selection of classes that are not reachable by the storyboard’s/xib’s main target. Further, in the case of a Swift-based project, it sets the Module setting to the target containing the class whether that’s sensible or not. For example, adding a custom button subclass that exists in the main app to a Today Widget’s view will set the Module value to the main app if the subclass has not been added to the Widget’s target. Steps to Reproduce: 1. Start with a basic project that includes an app and a Today Widget. 2. Add a button subclass to the app. 3. Add a button to the Today Widget’s storyboard. 4. Set the button’s class to the subclass created in #2. 5. The button will appear correctly in Interface Builder but will fail loading at runtime. Expected Results: Xcode should warn that the button subclass is not reachable, possibly prompting to add it to the target. Actual Results: The custom button will appear correctly in Interface Builder but will fail loading at runtime.
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!