I am working on a project with some of use on Xcode 7.2 and some on 7.3 (including myself). We don't want to force everyone to upgrade to 7.3 (most would also have to update their OS and we are closing in on release date).
If I use #selector()
as advised by Xcode for the new syntax anyone running 7.2 is unable to compile the project as they get an error. Using Selector("…")
allows the project to compile on all versions but it creates a warning that I would love to suppress (with a TODO next to it for removal once everyone has upgraded).
Is there any way to suppress this warning, or should I just live with it for now as a price of being fast to upgrade?
Update: By adding @objc
before the function in question the original warning changes to Use '#selector' instead of explicitly constructing a 'Selector'
, and it is willing to make the change for me making the code un-compilable on Xcode 7.2 or earlier.
As the issue isn't a deprecated method neither of the two existing answers work in this case (I would use the @avaliable
option to continue getting warnings about any other deprecated methods and make case-by-case decisions on each though).