Start a new topic

Date sorting with skip & limit modifiers | Building a Timeline

I am trying to build a timeline of user activities.I want the last 20 activities fetched and I also want to give user the ability to load earlier activities too.

How can I use date sorting with limit & skip modifiers?

Date is accessed from metadata.

This is my current implementation but I only get the first (older) 20 activities whether I choose Ascending or Descending.

KCSQuerySortModifier* dateStort = [[KCSQuerySortModifier alloc] initWithField:@"metadata._creationTime" inDirection:kKCSDescending];

[q1 addSortModifier:dateStort];

q1.limitModifer = [[KCSQueryLimitModifier alloc] initWithLimit:20];

q1.skipModifier = [[KCSQuerySkipModifier alloc] initWithcount:0];


Hey Aris, I wanted to let you know that our iOS dev is out of the office, so answers may be a bit delayed.
Instead of `@"metadata._creationTime"` use `KCSMetadataFieldCreationTime`.
Login or Signup to post a comment