When using Objective-C
which is the preferred method to pass objects from the DataManager
to the Interactor
when utilising the VIPER
architectural pattern.
In particular use of Block Based Callbacks
vs. a DataManager Output Protocol
The Sample To Do App from the Original Mutual Mobile article on VIPER
uses Block Based Callbacks
like so
- (void)todoItemsBetweenStartDate:(NSDate *)startDate endDate:(NSDate *)endDate completionBlock:(void (^)(NSArray *todoItems))completionBlock;
Whereas this approach from Brigade Engineering
utilises an OutputProtocol
on the DataManager
[self.interactor foundUser:user];
Which is the better method and why?
Note: I know when using Swift, closures can make the callback method a lot cleaner. This question is with direct reference to Objective-C.