Permalink
Browse files

Document delegate setting

  • Loading branch information...
1 parent efc4f99 commit bca811fc9618236c937d3945834d81201a7080ed @steipete committed Feb 28, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 PSTCollectionView/PSTCollectionView.m
@@ -1221,12 +1221,13 @@ - (void)setCollectionViewLayout:(PSTCollectionViewLayout *)layout {
}
-- (id<PSTCollectionViewDelegate>)delegate
-{
+- (id<PSTCollectionViewDelegate>)delegate {
return self.extVars.collectionViewDelegate;
}
- (void)setDelegate:(id<PSTCollectionViewDelegate>)delegate {
+ // We capture the delegate to get access to certain UIScrollView events.
+ // That's not needed when we are our own delegate (as long as parent behaves and properly calls super)
if (self.extVars.collectionViewDelegate != (id)self) {
self.extVars.collectionViewDelegate = delegate;
}
@@ -1251,8 +1252,7 @@ - (void)setDelegate:(id<PSTCollectionViewDelegate>)delegate {
// These aren't present in the flags which is a little strange. Not adding them because that will mess with byte alignment which will affect cross compatibility.
// The flag names are guesses and are there for documentation purposes.
- //
- // _collectionViewFlags.delegateCanPerformActionForItemAtIndexPath = [self.delegate respondsToSelector:@selector(collectionView:canPerformAction:forItemAtIndexPath:withSender:)];
+ // _collectionViewFlags.delegateCanPerformActionForItemAtIndexPath = [self.delegate respondsToSelector:@selector(collectionView:canPerformAction:forItemAtIndexPath:withSender:)];
// _collectionViewFlags.delegatePerformActionForItemAtIndexPath = [self.delegate respondsToSelector:@selector(collectionView:performAction:forItemAtIndexPath:withSender:)];
}

0 comments on commit bca811f

Please sign in to comment.