Iglistkit: The y position of sticky header was wrong after data changing

Created on 28 Jul 2017  路  5Comments  路  Source: Instagram/IGListKit

New issue checklist

General information

  • IGListKit version: 3.0
  • iOS version(s): iOS 11
  • CocoaPods/Carthage version: CocoaPods 1.0.1
  • Xcode version: 9 beta 3
  • Devices/Simulators affected: Simulators iPhone SE
  • Reproducible in the demo project? (Yes/No):
  • Related issues:

I used several ViewModel to combine a data array for IGListAdaper, and query data in one of the ViewModel instance, named CoreDataViewModel.

When adapter dataSource method listAdapter:sectionControllerForObject: invoke, and the object type is CoreDataViewModel, it return a CoreDataSectionController.

In CoreDataSectionController, numberOfItems method return a count of CoreDataViewModel's array.

Like this:

~~~objc

@protocol CoreDataViewModelDelegate

  • (void)viewModelDataDidUpdate:(CoreDataViewModelDelegate *)viewModel;

@end

@interface CoreDataViewModel : NSObject

@property (nonatomic, copy) NSArray *dataArray;

@property (nonatomic, weak) id < CoreDataViewModelDelegate> delegate;

@end

~~~

When CoreDataViewModel received database change notification, the delegate will invoke and the ViewController will reload the data like:

~objc
[self.adapter reloadDataWithCompletion:nil];
~

Every thing work well but in CoreDataSectionController, I implement sticky header with IGListSupplementaryViewSource and using IGListCollectionViewLayout for collectionView.

When reload the data, and the data array had someone object be removed, and the sticky header's y position will wrong. Until I scroll the collection view.

Is anything I forgot to set or something did wrong? Thanks for help.

--- Update ---

I can reproduce this problem in the following example project.

https://github.com/marcuswu0814/IGListKitStickyHeader

question

Most helpful comment

@rnystrom

I think it's my demo project and used IGListCollectionViewLayout,the topContentInset is hard code 64 cause this issue.

All 5 comments

Will take a look

Running the project above in Xcode 9 w/ iPhone X simulator and scrolling up also shows another bug where the sticky Header appears underneath the new UINavigationBar.

iphone_x

@DarrenAndes can you open a new issue for that? Include what collection view layout you鈥檙e using.

Sent with GitHawk

@rnystrom

I think it's my demo project and used IGListCollectionViewLayout,the topContentInset is hard code 64 cause this issue.

@marcuswu0814 closing due to inactivity, lmk if this is still an issue.

Was this page helpful?
0 / 5 - 0 ratings