[swift-users] #selector with Swift 3?

zh ao owenzx at gmail.com
Fri Jun 17 10:50:14 CDT 2016


Can you give more information on the function showRescale, is it function
showRescale() or showRescale(a:foo)?
Or have you tried case let x where x == #selector(showRescale):

Zhaoxin

On Fri, Jun 17, 2016 at 9:33 PM, Maury Markowitz via swift-users <
swift-users at swift.org> wrote:

> I was asked to try out the latest betas of Cocoa to check if a SceneKit
> bug I reported has been fixed. As part of this I decided to try an update
> to Swift 3. I've run into a number of minor issues, but one has me
> frustrated. In my menu validate method, I have:
>
>                 switch menuItem.action {
>                         case #selector!(showRescale) :
>
> This worked fine in 2.2, but now it complains that it expects a ( after
> #selector. Removing the ! fixes that problem, but now returns an error that
> there's a missing !, which it inserts to cause the original error again. I
> also tried placing it after the ()'s, and now it complains that it's
> expecting the :
>
> Does anyone know the proper Swift 3 syntax for this?
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160617/39bc8351/attachment.html>


More information about the swift-users mailing list