0

This is screen shot, in the last drop down menu is there, I clicked it and it's showing some menus that one

enter image description here

but instead of that, here I want to add sorting menus like,

1. sort by date
2. sort by name
3. sort by ...etc
always-a-learner
  • 3,671
  • 10
  • 41
  • 81

2 Answers2

1

i used DropDown for my project, we can easily customize these DropDownCell(customCell) & Appearance too.

You can able to integrate with your project through PODS

pod 'DropDown'

Dharma
  • 3,007
  • 3
  • 23
  • 38
  • Thanks for this help, but my project is in Objective c...! Any other solution ? – Sanjay Tiwari Jul 18 '17 at 05:36
  • You can integrate swift into Obj-c.check this link https://stackoverflow.com/questions/24102104/how-to-import-swift-code-to-objective-c – Dharma Jul 18 '17 at 05:47
0

For short array by a key.. Like Name....Put the key on which you want to short your array

This will Short your array Ascending

 NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"Your Key"  ascending:YES  selector:@selector(localizedStandardCompare:)];
 NSArray *shortedArray=[Your array sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor,nil]];

This will Short your array Decending

 NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"Your Key"  ascending:NO  selector:@selector(localizedStandardCompare:)];
 NSArray *shortedArray=[Your array sortedArrayUsingDescriptors:[NSArray arrayWithObjects:descriptor,nil]];
Parvendra Singh
  • 965
  • 7
  • 19