Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

30001713: Xcode_8.2.1 (8C1002): Extension protocol conformance prevents UIButton event connections in IB #16711

Open
openradar-mirror opened this issue Jan 12, 2017 · 5 comments

Comments

@openradar-mirror
Copy link

openradar-mirror commented Jan 12, 2017

Description

Summary:
If you make an extension on UIButton that conforms it to a protocol, you’ll no longer be able to connect to that button’s Sent Events outlets, such as Touch Up Inside.

Steps to Reproduce:
You can follow along with the attached project.

  1. Create a Single View iPhone application in Swift.
  2. Add a button to the main view controller in the storyboard. Observe that, in the Connections Inspector for that button, all the items under Sent Events are available for connection (e.g. Did End On Exit, Editing Changed, etc.).
  3. In ViewController.swift, add the following code:

protocol MyProtocol { }
extension UIButton: MyProtocol { }

  1. Go back to Interface Builder and click on the button. Observe that the button no longer has any Sent Events available for connection. If you had already assigned one of those events to an IBAction method, the Connections Inspector warns that “‘UIButton’ is no longer a valid event source.” as in the screenshot on this bug: BonMot disables IBActions dragging from storyboard Rightpoint/BonMot#252

Expected Results:
Adding an extension to UIButton that conforms it to a protocol has no bearing on whether you can add actions to it.

Actual Results:
Adding an extension to UIButton that conforms it to a protocol breaks the ability to connect actions to it in Interface Builder.

Regression:
Unknown. Reproduces back to Xcode 7.3.1 (7D1014), the earliest version I have installed on my machine.

Notes:
Sample project also posted here: https://cl.ly/ik9k

Product Version: Xcode_8.2.1 (8C1002)
Created: 2017-01-12T22:57:38.557280
Originated: 2017-01-12T17:57:00
Open Radar Link: http://www.openradar.me/30001713

@openradar-mirror
Copy link
Author

Modified: 2017-01-30T22:42:16.026780

@openradar-mirror
Copy link
Author

Modified: 2017-01-30T22:42:16.026780

3 similar comments
@openradar-mirror
Copy link
Author

Modified: 2017-01-30T22:42:16.026780

@openradar-mirror
Copy link
Author

Modified: 2017-01-30T22:42:16.026780

@openradar-mirror
Copy link
Author

Modified: 2017-01-30T22:42:16.026780

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant