vendredi 12 juin 2015

When implementing the VIPER pattern as described on objc.io, should care be taken to hide ReactiveCocoa as an implementation detail?

The guide at http://ift.tt/1f7H9Pq was highly instructive and while none of this is groundbreaking, I thought it was well-done.

The author suggested that the glue between layers ought to be the ReactiveCocoa library. I downloaded this via CocoaPods but I am bit stuck. I cannot find an example of ReactiveCocoa + the VIPER pattern.

My question: should I a) make sure to not expose the ReactiveCocoa classes in my interfaces, b) expose them because of their relevance, or c) not worry about it?

Compare a and b examples of my DetailsViewInteractorInputOutput.h

/* Eg A */

@protocol DetailsViewInteractorInput<NSObject>

- (void)requestDetails;

@end

/* Eg B */

@protocol DetailsViewInteractorInput<NSObject>

- (RACSignal *)requestDetails;

@end

/* Eg A */

@protocol DetailsViewInteractorOutput<NSObject>

- (void)foundDetails:(MyDetails *)details;

@end

/* Eg B */

@protocol DetailsViewInteractorOutput<NSObject>

- (RACSignal *)foundDetails;

@end

Aucun commentaire:

Enregistrer un commentaire