lundi 29 juin 2015

Reordering Mailcore2 mail folders


In my iOS project, I integrated mailcore2. I am able to get many features working viewing email, reply email, attach images etc.

I am also getting list of folders from the following code. I want to reorder the standard folders list starting from inbox, sent items, draft, Outbox, Trash and goes on to the last.

NSMutableArray *folderarray = [[NSMutableArray alloc] init];
[[self.imapSession fetchAllFoldersOperation] start:^(NSError *error, NSArray *folders) {
    NSMutableString *folderDetails = [NSMutableString new];
    for (MCOIMAPFolder *fdr in folders) {

        [folderDetails appendFormat:@"\nFolder[%@], flag : %d", fdr.path, fdr.flags];
        [folderarray addObject:fdr.path];
    }
    NSLog(@"Folder Details: %@", folderDetails);
    if (folderarray!=nil) {
        [folderList setAllFolders:folderarray];
        AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
        [appDelegate.leftMenu reloadTable];
    }
}];

I am not getting how to reorder/arrange the folders list?


Aucun commentaire:

Enregistrer un commentaire