<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I’m currently migrating some code to the new #selector syntax and came across an issue re: @objc visibility.<div class=""><br class=""></div><div class="">I have this method:</div><div class=""><br class=""></div><div class=""><font face="Monaco" class=""><span style="font-size: 15px;" class="">@IBAction private func tapGestureRecognized(gesture: UIGestureRecognizer) {…}</span></font></div><div class=""><br class=""></div><div class="">…and use this code to set up the recognizer:</div><div class=""><br class=""></div><div class=""><font face="Monaco" class=""><span style="font-size: 15px;" class="">let tapSelector = #selector(MyClass.tapGestureRecognized(_:))<br class="">let tapGesture = UITapGestureRecognizer(target: self, action: tapSelector)</span></font></div><div class=""><br class=""></div><div class="">The previous version with Selector(“…") worked fine. Now that I use #selector, I get this warning:</div><div class=""><br class=""></div><div class="">Argument of '#selector' refers to a method that is not exposed to Objective-C</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">Cheers</div><div class="">Sebastian</div><div class=""><br class=""></div></body></html>