Impossible to link outlet to custom protocol property in Xcode (Interface Builder)

Originator:yonic.surny
Number:rdar://32813076 Date Originated:6/16/2017
Status:Closed Resolved:
Product:iOS+SDK UIKit Product Version:iOS 10.3
Classification:Suggestion Reproducible:Always
 
Summary:
See steps to reproduce.

Steps to Reproduce:
In Xcode:
* Create a custom protocol:

@objc protocol FooBarDelegate {
    func foo(_ bar: Any)
}

* In a view (or view controller) add an outlet to the delegate:

@IBOutlet private weak var delegate: FooBarDelegate!

* Open the storyboard (or xib) and try to link the delegate property to any object.

Expected Results:
Ability to link the property to an object (same as any standard protocol like UIScrollViewDelegate, UITableViewDataSource, ...).

Observed Results:
No object is highlighted, impossible to link the property to an object.

Version:
Xcode 8.3 (iOS 10)
Xcode 9 (iOS 11)

Notes:
Following this method works: https://stackoverflow.com/a/29903609/1197572

* Declare the delegate as an AnyObject - @IBOutlet var delegate: AnyObject!
* Connect the delegate in Interface Builder
* Change the outlet's type to your protocol, e.g. @IBOutlet var delegate: MyDelegate

---

DUPLICATE OF 17023935

Comments

Apple Developer Relations / September 6 2017, 9:29 PM

The original report on your issue has been closed recently. Please note that you will not be able to directly view the original report in order to keep its information confidential.

If you have further questions about this issue, please update your report using the Apple Bug Reporter http://bugreport.apple.com.

By yonic.surny at March 6, 2018, 8:26 a.m. (reply...)

Apple Developer Relations / July 5 2017, 9:14 AM

Engineering has determined that your bug report is a duplicate of another issue and will be closed.

The open or closed status of the original report your bug was duplicated to appears in a text box within the bug detail section of the bug reporter user interface. For security and privacy reasons, we don't provide access to the original bug yours was duped to.

If you have any questions or concerns, please update your report directly at this link: https://bugreport.apple.com/.

By yonic.surny at March 6, 2018, 8:26 a.m. (reply...)

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!