[swift-users] #selector with Swift 3?

Nathan Day nathan_day at mac.com
Sun Jun 19 00:41:53 CDT 2016


I had a bit of problem getting #selector working with swift 3 I eventual got it to work with your second to last line I think, I've had a couple of problems with errors that I can't fix, type casting mainly, I have often found fixing other errors, even if they come after will make the initial error go away, I have passed it of as beta problems, I still have finished so I don't know if all my problems can be fixed like this.

Sent from my iPhone

On 18 Jun 2016, at 7:48 AM, Maury Markowitz via swift-users <swift-users at swift.org> wrote:

>> On Jun 17, 2016, at 1:31 PM, Brent Royal-Gordon <brent at architechies.com> wrote:
>> tl;dr: Write this instead:
>> 
>>    case #selector(showRescale)?:
> 
> Tried that too, it causes another error:
> 
>    /Developer/SwiftNEC 3/SwiftNEC/CardViews.swift:139:28: Expected ':' after 'case'
> 
> Here are the formats I have tried; all fail with various errors:
> 
>    case #selector(showRescale):
>    case #selector(showRescale)?:
>    case #selector(showRescale)? :
>    case #selector(showRescale)!:
>    case #selector(showRescale)! :
>    case #selector!(showRescale):
>    case #selector!(showRescale) :
> 
> This format, however, did work:
> 
>    case Optional.some(#selector(showRescale)):
> 
> Optional.some? Urk.
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users


More information about the swift-users mailing list