Date sorting with skip & limit modifiers | Building a Timeline
A
Aris Sarris
started a topic
almost 7 years ago
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.
Aris Sarris
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];
Thanks