-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support supplementaryViews created from nibs #90
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,8 +199,7 @@ - (UICollectionViewCell *)dequeueReusableCellOfClass:(Class)cellClass | |
- (UICollectionViewCell *)dequeueReusableCellWithNibName:(NSString *)nibName | ||
bundle:(NSBundle *)bundle | ||
forSectionController:(IGListSectionController<IGListSectionType> *)sectionController | ||
atIndex:(NSInteger)index | ||
{ | ||
atIndex:(NSInteger)index { | ||
const NSUInteger offset = [self offsetForSectionController:sectionController]; | ||
return (UICollectionViewCell *_Nonnull)[self.collectionContext dequeueReusableCellWithNibName:nibName | ||
bundle:bundle | ||
|
@@ -219,6 +218,19 @@ - (UICollectionReusableView *)dequeueReusableSupplementaryViewOfKind:(NSString * | |
atIndex:(index + offset)]; | ||
} | ||
|
||
- (UICollectionReusableView *)dequeueReusableSupplementaryViewOfKind:(NSString *)elementKind | ||
forSectionController:(IGListSectionController<IGListSectionType> *)sectionController | ||
nibName:(NSString *)nibName | ||
bundle:(NSBundle *)bundle | ||
atIndex:(NSInteger)index { | ||
const NSUInteger offset = [self offsetForSectionController:sectionController]; | ||
return (UICollectionViewCell *_Nonnull)[self.collectionContext dequeueReusableSupplementaryViewOfKind:elementKind | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this cast? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not quite understand why (UICollectionViewCell *_Nonnull) is needed here, just following the previous method implementation since I have not read all the source code yet, i think UICollectionReusableView is more suitable here, am i wrong? |
||
forSectionController:self | ||
nibName:nibName | ||
bundle:bundle | ||
atIndex:(index + offset)]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we realign the colons? |
||
} | ||
|
||
- (void)reloadInSectionController:(IGListSectionController<IGListSectionType> *)sectionController atIndexes:(NSIndexSet *)indexes { | ||
NSIndexSet *itemIndexes = [self itemIndexesForSectionController:sectionController indexes:indexes]; | ||
[self.collectionContext reloadInSectionController:self atIndexes:itemIndexes]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add:
I realize those are also missing from other methods. Adding some starter tasks for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bundle
should benullable
here, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for that, I'm trying this framework, hope to have this feature ASAP, without attention to details
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rawlinxx no worries! PRs are an iterative process, its good to get something up and we can all work on it together 👨👩👧👦