MrAlek / PagedArray

A Swift data structure for easier pagination

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does PagedArray play well with SwiftlyJSON?

acegreen opened this issue · comments

Hello

Just wondering if this library plays well with JSON data Object. If so, how'd you go about linking them together?

if it?
pagedArray.setElements(JSONobject.arrayobject, pageIndex: 1)

I would create real model objects from the JSON array before putting them in the PagedArray but otherwise it should work :)

@MrAlek What do you mean real model objects?

Let's say you're fetching users, instead of using plain JSON objects you could have a User class or struct that you create from a JSON dictionary. But for this library, you can use plain JSON objects as well, no problem.