Load Mails using pagination concept




I was looking to load cocuhbase mails using pagination concept. Yeah we have a method to pass the limit (mails count).Below is the method,

(CBLQuery*) select: (NSArray<CBLQuerySelectResult*>)select
from: (CBLQueryDataSource
where: (nullable CBLQueryExpression*)where
groupBy: (nullable NSArray<CBLQueryExpression*>)groupBy
having: (nullable CBLQueryExpression
orderBy: (nullable NSArray<CBLQueryOrdering*>)orderings
limit: (nullable CBLQueryLimit

/** Logic goes here */


Here i have a doubt, if i give the limit 10/20, can be able to load those number of mails.I don’t need this requirement.

As soon as i scroll the table the view, i would like to pass the Offset value, so that i can be able to get the mails from there itself.

Here in the above code, i am not able to apply the pagination concept.

I would like to load 10 mails on each scroll, not bunch of mails at a time.

Any help would be appreciated…