Conforming a class to a protocol prevents Interface Builder connecting an instance to an outlet for a different protocol conformed to by its superclass.
| Originator: | johnpatrickmorganuk | ||
| Number: | rdar://27243319 | Date Originated: | 08-Jul-2016 |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | |
| Classification: | Reproducible: |
Summary: Conforming a class to a protocol prevents Interface Builder connecting an instance of that class to an outlet for a different protocol conformed to by its superclass. Steps to Reproduce: 1. Open Main.storyboard in attached project. 2. Attempt to connect the UILabel to ViewController's backgroundColorable property. Expected Results: It should be possible to connect the UILabel to ViewController's backgroundColorable property, as UIView (UILabel's superclass) conforms to BackgroundColorable. Actual Results: It is not possible to connect the UILabel to ViewController's backgroundColorable property. However, performing the following steps will resolve the issue: 4. Roll back latest commit (or comment out UILabel's conformance to TextColorable, an unrelated protocol). 5. Reattempt steps reproduce, observing that it is now possible. UILabel's conformance to TextColorable should not prevent Interface Builder recognising UILabel's inherited conformance to BackgroundColorable. Version: Xcode 7.3 (7D175) and 8.0 beta (8S128d) OSX 10.11.4 (15E65) Notes: Configuration: iMac (27-inch, Late 2013) Attachments: 'ProtocolOutletTest2.zip' was successfully uploaded.
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!