The Wayback Machine - https://web.archive.org/web/20200912061254/https://github.com/zedxpp/PPNameSort
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

README.md

PPNameSort

对App中的联系人数组模型进行排序.

使用方式

1 #import "PPNameSort.h"

2 创建模型(从服务器)

NSMutableArray *arr = [NSMutableArray array];
PPObject *model = [PPObject new];
model.nickName = @"啦啦";
[arr addObject:model];

3 将模型数组导入并获取回调

arr 模型数组
@"nickName" 需要排序的模型属性名
sortedModelDict 回调

[PPNameSort sortWithModels:arr sortPropertyNameString:@"nickName" sortedModelDict:^(NSMutableDictionary<NSString *,NSMutableArray *> *sortedModelDict, NSMutableArray *nameKeys) {
        NSLog(@"sortedModelDict = %@", sortedModelDict);
        NSLog(@"nameKeys = %@", nameKeys);
}];

4 最终获取到的数据

2017-06-26 17:31:45.532 PPNameSort[7814:261673] sortedModelDict = {
    "#" =     (
        "<PPObject: 0x60000001ce00>",
        "<PPObject: 0x60000001cec0>"
    );
    A =     (
        "<PPObject: 0x60000001ceb0>"
    );
    L =     (
        "<PPObject: 0x60000001cd80>"
    );
    S =     (
        "<PPObject: 0x60000001cdb0>"
    );
}
2017-06-26 17:31:45.532 PPNameSort[7814:261673] nameKeys = (
    A,
    L,
    S,
    "#"
)

本项目根据 PPGetAddressBook 框架进行简单修改后提取出来的. 已保留原项目的注释.

About

Sort the name array model by A-Z. 对App中的联系人数组模型进行排序.

Topics

Resources

License

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.