Skip to content

Added preloading items, defaults to 0 - #102

Open
coneybeare wants to merge 3 commits into
nicklockwood:masterfrom
coneybeare:master
Open

Added preloading items, defaults to 0#102
coneybeare wants to merge 3 commits into
nicklockwood:masterfrom
coneybeare:master

Conversation

@coneybeare

Copy link
Copy Markdown

#34

I added some preloading items to assist with views that grab content from the web. This prevents flickering for the most part, as long as the user swipes at a normal pace. It defaults to 0 items preloaded, other than any of the existing preloaded views from the visibleInidices

@vassily-fr

Copy link
Copy Markdown

You should also not unload view that are in preloading arrays :
//remove offscreen views
for (NSNumber *number in [_itemViews allKeys])
{
if (![visibleIndices containsObject:number] && ![preloadedIndices containsObject:number])
{
DLog(@"unloading view at index %@",number);
UIView *view = _itemViews[number];
[self queueItemView:view];
[view removeFromSuperview];
[_itemViews removeObjectForKey:number];
}
}

@fernandomatal

Copy link
Copy Markdown

Any updates about this? Sounds like a good idea.

@lewis-smith lewis-smith left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been using this for a long time and it works fine and improves response time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants