0

if I have something like:

void maybeHandleMessage: sender: AnyObject {
    if isHandling() {
        handle()
    } else {
        // forward action message to next responder in the responder chain
    }
}

What code do I need in the else clause to forward the maybeHandleMessage?

rmaddy
  • 314,917
  • 42
  • 532
  • 579

1 Answers1

0

If your object is a kind of subclass of UIResponder there is a method

func nextResponder() -> UIResponder?

you can try

dopcn
  • 4,218
  • 3
  • 23
  • 32
  • This is found in the cocoa event handling guide: "Warning: Although NSResponder declares a number of action messages, it doesn’t actually implement them. You should never send an action message directly to a responder object of an unknown class. Always use the NSApplication method sendAction:to:from:, the NSResponder methods tryToPerform:with: or doCommandBySelector:, or check that the target responds using the NSObject method respondsToSelector:." So, is the only way to use the sendAction again? – corporate_fun Sep 30 '14 at 16:20