Removed RACCommand from view model.

This commit is contained in:
Ash Furrow
2013-10-22 18:47:44 -04:00
parent 4c848aa915
commit 8cf696d1cd
3 changed files with 2 additions and 11 deletions

View File

@@ -57,7 +57,7 @@ static NSString *CellIdentifier = @"Cell";
// Binding to view model
@weakify(self);
[self.viewModel.collectionViewReloadCommand.executionSignals subscribeNext:^(id x) {
[RACObserve(self.viewModel, photosArray) subscribeNext:^(id x) {
@strongify(self);
[self.collectionView reloadData];
}];

View File

@@ -12,6 +12,4 @@
@property (nonatomic, strong) NSArray *photosArray;
@property (nonatomic, strong) RACCommand *collectionViewReloadCommand;
@end

View File

@@ -17,14 +17,7 @@
self = [super init];
if (!self) return nil;
@weakify(self);
self.collectionViewReloadCommand = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id input) {
return [RACSignal empty];
}];
RAC(self, photosArray) = [[[[FRPPhotoImporter importPhotos] doCompleted:^{
@strongify(self)
[self.collectionViewReloadCommand execute:nil];
}] logError] catchTo:[RACSignal empty]];
RAC(self, photosArray) = [[[FRPPhotoImporter importPhotos] logError] catchTo:[RACSignal empty]];
return self;
}