Comments (3)
Thanks for setting up the issue.
I've been thinking about what to do with the last page, if it should be treated like all the others and require correct sizing or not. Since the array will mostly be used with a paging web service, the total count might differ from when you load the first page and you get the last.
What do you think, should I enforce correct sizing or make the array compensate on the last page itself?
from pagedarray.
I would not enforce the size in last page.
I came across this issue when adding a few methods to reorder, insert and delete elements in the array so I don't need to reload all the pages again.
I applied a local fix looping through the pages and collecting the elements.
I think that just returning the loaded elements avoiding the crash is good enough.
Sent from my iPhone
On May 11, 2015, at 4:49 PM, Alek ร strรถm [email protected] wrote:
Thanks for setting up the issue.
I've been thinking about what to do with the last page, if it should be treated like all the others and require correct sizing or not. Since the array will mostly be used with a paging web service, the total count might differ from when you load the first page and you get the last.
What do you think, should I enforce correct sizing or make the array compensate on the last page itself?
โ
Reply to this email directly or view it on GitHub.
from pagedarray.
I've taken a different take on this now (3c70011). In the 0.2 version, you have two options:
- Adjust the
count
property on the paged array before setting the mis-sized page. - Set the
updatesCountWhenSettingPages
property totrue
, which removes all page size checking and dynamically adjusts the paged array to fit. That also makes infinite lists easy to implement since you can just append new pages.
from pagedarray.
Related Issues (18)
- Does PagedArray play well with SwiftlyJSON? HOT 3
- Real working example HOT 3
- Please add support for tvOS. HOT 1
- How to deal with unknown data count HOT 3
- In comparison to using Realm. What are some tradeoffs and benefits of using this paging system? HOT 1
- Migrate to Swift 2.3 and Swift 3 HOT 4
- Changes in the dataset HOT 1
- How do we deal with memory warning issues when memory runs out because of setting so many new elements into the array? HOT 1
- Subscript crash when count changed HOT 3
- Connecting with the API responses HOT 1
- Multiple API calls HOT 2
- Example with Alamofire HOT 1
- Array representation: [nil] HOT 2
- Index out of bounds HOT 5
- No shared scheme to work with Carthage HOT 2
- Setting the PagedArray with an empty array hit the assert "Page index out of bounds" HOT 5
- Swift 2.0 Update? 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 pagedarray.