Closed milestinsley closed 12 years ago
Looks nice. Wouldn't observing WLRemoteLink
's state allow you to see when it's in WLRemoteLinkStateAuthenticationError
or WLRemoteLinkStateRequestFailureError
?
Observing changes to WLRemoteLinks
's state was my original thought, but the state won't change on every action.
I specifically needed to know every time an action was finished, even if the state is already WLRemoteLinkStateNormal
(and doesn't change).
Ok, I understand what you mean now. At first it appeared that observing WLRemoteLinks
's state would only trigger when it actually changes state. But I've been playing around with it and as you suggest, the observer does in fact fire whenever the state is set internally, regardless of if it has changed or not.
This is just what I needed! Thanks for your help. I'll close this PR.
Actually it might not be a bad pull request either way. I was planning to merge it. :)
I needed this feature for our app and thought it would be a useful addition to the framework.
The need arose when I wanted my session controller to know whenever a Ratatosk persistence action finished or failed.
This update simply lets you set a
delegate
on the sharedWLRemoteLink object
i.e.:The delegate will then receive the following messages:
- (void)remoteActionDidFail:(WLRemoteAction)anAction dueToAuthentication:(BOOL)dueToAuthentication
- (void)remoteActionDidFinish:(WLRemoteAction)anAction