Comments (2)
some performance issues with the data model
TLIPT shouldn't have performance issues with 700 items. However, we've experienced performance issues with UICollectionView's
internal batch update process when the number of items gets that large. UICollectionView
just can't handle large batch updates.
Did you specifically identify a performance problem within the TLIPT code?
So I figured that just clearing out the collection view and then rebuilding it would make it faster, and it does.
The way we've handled this problem is to use [UITableView reloadData]
instead of performing batch updates. We did this inside a [UIView transitionWithView]
with a page flip animation.
It sounds like what you're trying to do is perform one batch update from your old data model to an empty date model, followed by another batch update from the empty data model to the new data model. Is that right?
Here's what happening. If TLIPT can't determine the section name for an item, then it puts it in a section with the internal name TLIndexPathDataModelNilSectionName
. There is a bug in UICollectionView
that crashes if you try to load the view with zero sections. So TLIndexPathDataModel
has a workaround of creating an empty section using the internal section name. Here are the comments from the code:
if there are no sections, insert an empty section to keep UICollectionView
happy. If we don't do this, UICollectionView will crash on the first
update because it internally thinks there is 1 section when the
UICollectionView controller reports zero sections.
I have not checked if that bug still exists in iOS8. I'll put that on my todo list.
My recommendation, and what I've done in the past, is to set up your delegate to return a blank view or zero size for that section. Or you could try setting the data model to nil
and see if the collection view crash bug has been fixed. As I recall, the bug only happened on the first update, so it might not affect you at all.
from tlindexpathtools.
The code is indeed only slow when it has to move around all the items. The comment in that bit of code (https://github.com/wtmoose/TLIndexPathTools/blob/master/TLIndexPathTools/Data%20Model/TLIndexPathUpdates.m#L364) also shows a better suggestion, which I didn't see until after posting this comment.
I did implement the solution based on the comment and now it works acceptably fast. Thanks for the suggestions
from tlindexpathtools.
Related Issues (20)
- TLCollectionViewController with fetchRequest delete NSManagedObject fault crash HOT 2
- Changing the TLIndexPathDataModel while animations under way causes crash HOT 1
- DataModel+IndexPathUpdates do not detect modified Core Data model objects HOT 2
- Realm HOT 3
- Same item in multiple sections: Possible? HOT 2
- Swift support HOT 4
- Warning : Duplicate Item Ignored (Noob Question) HOT 2
- Wrong optionality on controller: willUpdateDataModel: HOT 2
- Swift support HOT 1
- Swift Implementation Question HOT 2
- TLCollapsibleTableViewController
- Crash when reordering items HOT 2
- Unable to get dynamic height working HOT 4
- Cocoa Pod HOT 2
- TLTreeTableViewController: Keep only one expanded parent (close others) HOT 2
- NSManagedObject changes not detected by TLIndexPathController HOT 19
- Analysis Warning -- FYI HOT 1
- Another Suggestion Needed : Boxing Swift Structs HOT 4
- Non-ideal hash calculation HOT 3
- Drawback in case of adding dynamic data from API in multilevel expandable tableview/accordion HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tlindexpathtools.