Andrespch February 2016

Implementing UICollectionViewDelegate with RA Signals

I'm trying to add a signal to implement some events of the UICollectionViewDelegate protocol, the signals are never fired, I also tried resetting the delegate object after I've created the signal, any ideas why this is not working?

  self.answerSelectionSignal = [self.collectionView rac_signalForSelector:@selector(collectionView:didSelectItemAtIndexPath:) fromProtocol:@protocol(UICollectionViewDelegate)];
[self.answerSelectionSignal
    subscribeNext:^(RACTuple *tuple) {
      self.actionButton.enabled = YES;
    }];
 self.collectionView.delegate = nil;
self.collectionView.delegate = self;

Thanks

Answers


Andrespch February 2016

Found the problem, the selector is implemented by the view controller, in this case "self", I was trying to get the signal from the collectionView which doesn't make any sense.

Post Status

Asked in February 2016
Viewed 1,775 times
Voted 13
Answered 1 times

Search




Leave an answer