objective c - Replacing delegate methods that return values -
using reactivecocoa cleaner , centralized way handle events delegate methods, wondering if possible replace methods homecoming values without losing value.
in illustration below, method gesturerecognizer:shouldreceivetouch:
uigesturerecognizerdelegate
called, method signature expects bool homecoming value effective. way, gesture recognizer don't work, if method returned no
is possible utilize rac replace kind of method?
[[self rac_signalforselector:@selector(gesturerecognizer:shouldreceivetouch:) fromprotocol:@protocol(uigesturerecognizerdelegate)] subscribenext:^(id x){ nslog(@"was called, how homecoming actual permission value?"); }]; self.backgroundtapgesture.delegate = self;
is possible utilize rac replace kind of method?
nope. -rac_signalforselector:
cannot used on selectors of non-existent methods, of non-void homecoming types. in these cases, implement method homecoming desired value. makes existent method, -rac_signalforselector:
can applied to.
objective-c reactive-cocoa
No comments:
Post a Comment