unable to use nested types in interface builder

Originator:natbro
Number:rdar://19420664 Date Originated:1/8/2015
Status:Closed Resolved:Duplicate of 18753511
Product:Developer Tools Product Version:XCode Version 6.2 (6C101)
Classification:Other Bug Reproducible:Always
 
it's convenient to use nested types to customize a class backed by a .XIB file, but interface builder silently eliminates nested-class syntax, fails to associate to your nested class, and instantiates the original base class in the .XIB. for example given the following class if i make a MyView.XIB file with a UIView containing a UITextField and specify MyView as the custom class for the UIView and MyView.MyTextField as the custom class for the UITextField, Interface Builder will silently convert "MyView.MyTextField" to "MyTextField" and at runtime will throw a silent error about "MyTextField" not being found, and will instantiate a UITextField in its place.

import Foundation

class MyView : UIView {    
    @IBOutlet weak var text : MyTextField!
    
    class MyTextField : UITextField {
        // some customization here which will never happen
    }
}

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!