09 Aug 2014
Kyle on targetViewController
Kyle Sluder, targetViewControllerForAction:sender: is smarter than it seems:
targetViewControllerForAction: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.