Xcode 10 Bundle(for) returns wrong bundle under iOS 10, 11

Originator:sebskuse
Number:rdar://42961643 Date Originated:August 6 2018, 9:58 AM
Status:Open Resolved:
Product:Xcode 10 Product Version:10.0 beta 5 (10L221o)
Classification:Bug Reproducible:Always
 
Summary:
Bundle(for:) on a a generic UIView subclass contained in a framework returns the main app bundle rather than the framework bundle. 

When registering cell nibs this causes a crash as it attempts to load them from the wrong place.

Steps to Reproduce:
1. Compile using Xcode 10 (Version 10.0 beta 5 (10L221o))
2. Run on a device running iOS 10 or 11
3. Crash

Expected Results:
Bundle(for) should return the bundle the class was defined in, and no crash should occur.


Actual Results:

Under iOS 10 or 11 the bundle returned is always the main app bundle. A test project has been attached which under iOS 10 or 11 will crash.


Version/Build:
Xcode 10 (Version 10.0 beta 5 (10L221o))
OSX High Sierra 10.13.6 (17G65)

Configuration:

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!