The previous version with Selector(“…") worked fine. Now that I use #selector, I get this warning:

Argument of '#selector' refers to a method that is not exposed to Objective-C

My understanding was that @IBAction always implied @objc. I can easily fix the warning, either by adding @objc or by removing the private modifier, but I’d like to understand why @objc@IBAction works, but @IBAction does not. I’d like to keep the private modifier. If this is a bug/limitation, I will file a bug report. Just wanted to make sure that I understand it correctly.

- The implementation of @IBAction uses @objc.
- In theory we could some day have @IBActions that do not use the ObjC runtime.
- But I agree that having to type "@IBAction@objc private func foo…" seems like a bit much.

The previous version with Selector(“…") worked fine. Now that I use #selector, I get this warning:

Argument of '#selector' refers to a method that is not exposed to Objective-C

My understanding was that @IBAction always implied @objc. I can easily fix the warning, either by adding @objc or by removing the private modifier, but I’d like to understand why @objc@IBAction works, but @IBAction does not. I’d like to keep the private modifier. If this is a bug/limitation, I will file a bug report. Just wanted to make sure that I understand it correctly.

- The implementation of @IBAction uses @objc.
- In theory we could some day have @IBActions that do not use the ObjC runtime.
- But I agree that having to type "@IBAction@objc private func foo…" seems like a bit much.

The previous version with Selector(“…") worked fine. Now that I use #selector, I get this warning:

Argument of '#selector' refers to a method that is not exposed to Objective-C

My understanding was that @IBAction always implied @objc. I can easily fix the warning, either by adding @objc or by removing the private modifier, but I’d like to understand why @objc@IBAction works, but @IBAction does not. I’d like to keep the private modifier. If this is a bug/limitation, I will file a bug report. Just wanted to make sure that I understand it correctly.