Revision 3ef56992 Classes/Folder.m
b/Classes/Folder.m | ||
---|---|---|
222 | 222 |
#pragma mark - Actions |
223 | 223 |
|
224 | 224 |
- (NSArray *)sortedContentsUsingFilter:(NSString *)filter scope:(NSString *)scope |
225 |
sortType:(NSString *)sortType sortDirection:(NSString *)sortDirection {
|
|
225 |
sortType:(FolderSortType)sortType sortDirection:(FolderSortDirection)sortDirection {
|
|
226 | 226 |
NSArray *sortedContents = nil; |
227 |
if ([sortType isEqualToString:@"date"]) {
|
|
227 |
if (sortType == FolderSortTypeDate) {
|
|
228 | 228 |
sortedContents = self.sortedContentsByDate; |
229 | 229 |
} else { |
230 | 230 |
sortedContents = self.sortedContentsByName; |
231 | 231 |
} |
232 |
if ([sortDirection isEqualToString:@"Z-A"]) {
|
|
232 |
if ((sortDirection == FolderSortNameDirectionZA) || (sortDirection == FolderSortDateDirectionNewestFirst)) {
|
|
233 | 233 |
sortedContents = [[sortedContents reverseObjectEnumerator] allObjects]; |
234 | 234 |
} |
235 | 235 |
if (!filter || !filter.length) { |
Also available in: Unified diff