Kyle on targetViewController

Kyle Sluder, targetViewController​ForAction:​sender: is smarter than it seems:

targetViewController​ForAction:​sender: does indeed walk the view controller hierarchy, sending -canPerformAction:​withSender: on the way. But if a view controller returns YES, it will then determine whether the instance’s method for that selector is an override of a UIViewController implementation for the same selector. If not, it keeps looking up the chain.

That’s kind of weird. But, well, it’s pragmatic, too.

09 Aug 2014

Archive

Ads via The Deck