Xcode will be happy if you add “@objc” in front of your “func” declaration. 

> On 23 Sep 2016, at 2:51 PM, Gerriet M. Denkmann via swift-users 
> <swift-users@swift.org> wrote:
> 
> This line (Swift 3):
>       if a.responds(to: Selector(“viewControllers") )
> creates this warning: Use '#selector' instead of explicitly constructing a 
> 'Selector'
> 
> Ok. Following this advice I change it to:
>       if a.responds(to: #selector(“viewControllers"))
> and now get an error instead: Argument of ‘#selector' does not refer to an 
> '@objc' method, property, or initializer
> 
> Why do I get punished for following Xcode’s advice?
> 
> Gerriet.
> 
> _______________________________________________
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to