Skip to content

Commit

Permalink
expose trait collection
Browse files Browse the repository at this point in the history
Summary: this can be helpful when section controllers calculate size depending on the size class

Differential Revision: D50425042

fbshipit-source-id: 5fbafe1b0662ffb428c42bf99593868915dfc6c7
  • Loading branch information
Sash Zats authored and facebook-github-bot committed Oct 23, 2023
1 parent 5e79f8a commit 53a96a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/IGListKit/IGListAdapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,10 @@ - (CGSize)containerSize {
return self.collectionView.bounds.size;
}

- (UITraitCollection *_Nullable)traitCollection {
return self.collectionView.traitCollection;
}

- (UIEdgeInsets)containerInset {
return self.collectionView.contentInset;
}
Expand Down
2 changes: 2 additions & 0 deletions Source/IGListKit/IGListCollectionContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ NS_ASSUME_NONNULL_BEGIN
NS_SWIFT_NAME(ListCollectionContext)
@protocol IGListCollectionContext <NSObject>

@property (nonatomic, nullable, readonly) UITraitCollection *traitCollection;

/**
The size of the collection view. You can use this for sizing cells.
*/
Expand Down

0 comments on commit 53a96a9

Please # to comment.