Migrating my code to Swift 2.2, I have a property
Use of unresolved identifier
The issue here is that you're working with a property, not a method. This has two problems:
#selectorexpression requires a Swift function/method reference.
When Swift compiles your source, it doesn't know that the ObjC
-(void)setActiveTextField:(UITextField*)field methods will exist, so it can't generate function references for them. Since it can't generate a function reference, it doesn't have something it can use for the
For now, there isn't a way to use
#selector to access property getters/setters — using
Selector(...) with a string constant is your only option.
(This is actually just a new face on a longstanding known issue... it's the same reason you also can't pass a property getter/setter to something like
filter. I think I've seen something on http://bugs.swift.org about this, but I'm not finding it at the moment.)