Skip to content

Commit

Permalink
Added didLayoutForFrame for cells
Browse files Browse the repository at this point in the history
  • Loading branch information
kettch committed May 31, 2016
1 parent 38ec08a commit fb5646a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions JNWCollectionView/JNWCollectionViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,7 @@
/// Called when the cell will be layed out using the provided frame.
- (void)willLayoutWithFrame:(CGRect)frame;

/// Called when the cell has been laid out using the provided frame.
- (void)didLayoutWithFrame:(CGRect)frame;

@end
4 changes: 4 additions & 0 deletions JNWCollectionView/JNWCollectionViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ - (void)willLayoutWithFrame:(CGRect)frame {
// for subclasses
}

- (void)didLayoutWithFrame:(CGRect)frame {
// for subclasses
}

- (NSView *)contentView {
if (_contentView == nil) {
_contentView = [[NSView alloc] initWithFrame:self.bounds];
Expand Down
2 changes: 2 additions & 0 deletions JNWCollectionView/JNWCollectionViewFramework.m
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,8 @@ - (void)applyLayoutAttributes:(JNWCollectionViewLayoutAttributes *)attributes to
cell.frame = attributes.frame;
cell.alphaValue = attributes.alpha;
cell.layer.zPosition = attributes.zIndex;

[cell didLayoutWithFrame:attributes.frame];
}

#pragma mark Supplementary Views
Expand Down

0 comments on commit fb5646a

Please sign in to comment.