<div dir="ltr">I tried, writing that as @objc(action:) #selector(ClassName.action(_:)) but that got an &quot;expected declaration&quot; error.<div><br></div><div>I also tried adding @objc(action:) to the method itself (which seems redundant anyway), but that didn&#39;t help either.<br><br>On Tue, Dec 6, 2016 at 11:50 AM, Joe Groff &lt;<a href="mailto:jgroff@apple.com">jgroff@apple.com</a>&gt; wrote:<br>&gt;<br>&gt;<br>&gt; &gt; On Dec 6, 2016, at 8:54 AM, David Catmull via swift-users &lt;<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; wrote:<br>&gt; &gt;<br>&gt; &gt; I have a unit test in which I verify that a view controller is correctly validating items in a context menu. I converted the view controller class to Swift, keeping the selector names the same, while the test is still in ObjC. The test now doesn&#39;t work because the selector created in ObjC as @selector(action:) somehow isn&#39;t matching Swift&#39;s #selector(ClassName.action(_:)). Do I have to rewrite my test in Swift for this to work?<br>&gt;<br>&gt; You could try giving ClassName.action(_:) an explicit selector using the @objc(action:) attribute to ensure that it&#39;s consistent with the ObjC code. If that doesn&#39;t work, then we may have a bug in the compiler.<br>&gt;<br>&gt; -Joe<br>&gt;<br></div></div>