This is a huge change. In principle, this closes the largest hole in the tongue.
If you form the Selector as a string literal, and you are not mistaken - it is too simple - or if you correctly formulated it, but this method does not undergo Objective-C, you will encounter a scary message at the runtime Unrecognized selector console message - the most common failure in both Objective-C and Swift. (Do a stack overflow on an "unrecognized selector", you'll see what I mean.)
Now the syntax #selector
means that you will form a Selector using a link to a function that the compiler will check at compile time. If you make a mistake, the compiler will stop you. If you do everything right, the compiler will form a Selector for you - right. You do not need to know anything about how to form a Selector string; the compiler does all the work. Thus, your chance to collide in this way is effectively reduced to zero. An โunrecognized selectorโ accident is dead as an outsider.
source share