mirror of
https://github.com/zhigang1992/FunctionalReactivePixels.git
synced 2026-01-12 22:47:31 +08:00
Removed RACCommand from view model.
This commit is contained in:
@@ -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];
|
||||
}];
|
||||
|
||||
@@ -12,6 +12,4 @@
|
||||
|
||||
@property (nonatomic, strong) NSArray *photosArray;
|
||||
|
||||
@property (nonatomic, strong) RACCommand *collectionViewReloadCommand;
|
||||
|
||||
@end
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user