Re: [swift-users] Swift 3 likes to tease me

2016-09-23 Thread Joe Groff via swift-users
> On Sep 22, 2016, at 9:51 PM, Gerriet M. Denkmann via swift-users > 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

Re: [swift-users] Swift 3 likes to tease me

2016-09-23 Thread Jacob Bandes-Storch via swift-users
Once you've determined this object responds to the selector, how do you intend to use it? It's probably best to define your own protocol that has the requirement, and then you can access it via the protocol. In fact, at that point you might even be able to use "as?" rather than

Re: [swift-users] Swift 3 likes to tease me

2016-09-23 Thread Gerriet M. Denkmann via swift-users
> On 23 Sep 2016, at 12:09, Marco S Hyman wrote: > > On Sep 22, 2016, at 9:51 PM, Gerriet M. Denkmann via swift-users > wrote: >> >> This line (Swift 3): >> if a.responds(to: Selector(“viewControllers") ) >> creates this warning: Use '#selector'

Re: [swift-users] Swift 3 likes to tease me

2016-09-23 Thread Jacob Bandes-Storch via swift-users
#selector is not used with a string, but with an actual reference to a method. If, for instance, you have a protocol MyVC which declares `var viewControllers: ...` then you can use something like #selector(MyVC.viewControllers). On Thu, Sep 22, 2016 at 9:51 PM, Gerriet M. Denkmann via swift-users

Re: [swift-users] Swift 3 likes to tease me

2016-09-22 Thread Adam Eberbach via swift-users
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 > wrote: > > This line (Swift 3): > if a.responds(to: Selector(“viewControllers") ) > creates this warning: Use

[swift-users] Swift 3 likes to tease me

2016-09-22 Thread Gerriet M. Denkmann via swift-users
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: