Latest 0.2.1
Homepage https://github.com/qq1932121/LXR_CHNGroup
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

CI Status
Version
License
Platform


⭐️⭐️⭐️ LXR_CHNGroup只为技术交流,如有问题,欢迎各路大神指教 ⭐️⭐️⭐️

如果您在使用 LXR_CHNGroup 的过程中出现bug或有更好的建议,还请及时以下列方式联系我,我会及时修复bug,解决问题.

* QQ :    1932121
* Email : [email protected]
* GitHub: https://github.com/qq1932121
* 简书:    http://www.jianshu.com/u/59557cdcd06e

如果 LXR_CHNGroupKit 好用,希望您能Star支持,你的 ⭐️ 是我持续更新的动力!

主要功能分为两个功能类

  • LXR_CHNGroupManager根据模型数组和根据Key排序
    • 示例代码
/// 方法调用
/// ContactModels : 传进来模型数组
/// SortKey       : 排序的Key
[[LXR_CHNGroupManager sharedContactManager] contactManagerWithContactModels:self.contactSource SortKey:@"userName" CompletionGroupBlock:^(NSMutableArray *titles, NSMutableArray *groupArray) {

    // [A-Z]数组
    self.sectionTitles = titles;
    // 模型数组
    self.dataArray = groupArray;
    // 刷新
    [self.tableView reloadData];

} Failure:^(NSError *error) {
NSLog(@"%@",error.description);
}];
  • AddressBookManager调用系统通讯录就行分组
    • 示例代码(获取原始顺序排列的所有联系人)
//1.获取通讯录权限
[[AddressBookManager sharedManager] requestAuthorizationWithSuccessBlock:^(BOOL isSuccess) {
    if (isSuccess) {
    //2.获取通讯录
    [[AddressBookManager sharedManager] getOriginalAddressBook:^(NSArray<PersonModel *> *addressBookArray) {
        self.addressArray = addressBookArray;
        [self.tableView reloadData];
    } authorizationFailure:^{
        //2 弹框
        [self showAlert];
    }];
}
}];
- 示例代码(获取按A~Z顺序排列的所有联系人)
//1.获取通讯录权限
[[AddressBookManager sharedManager] requestAuthorizationWithSuccessBlock:^(BOOL isSuccess) {
    if (isSuccess) {
        //2.获取分组通讯录
        [[AddressBookManager sharedManager] getOrderAddressBook:^(NSDictionary<NSString *,NSArray *> *addressBookDict, NSArray *nameKeys) {

        self.addressBookDict = addressBookDict;
        self.titles = nameKeys;
        [self.tableView reloadData];

        } authorizationFailure:^{
        // 失败操作处理...
        }];
    }else{
    // 失败操作处理...
    }
}];
  • 此功能参考PPGetAddressBook框架,十分感谢,从中学到很多知识

CocoaPods安装

LXR_CHNGroup is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "LXR_CHNGroup"

作者

LXR, [email protected]

License

LXR_CHNGroup is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "LXR_CHNGroup",
    "version": "0.2.1",
    "summary": "LXR_CHNGroupu4e2du6587u5206u7ec4",
    "description": "LXR_CHNGroupu4e2du6587u5206u7ec4,u4e00u53e5u4ee3u7801u641eu5b9a",
    "homepage": "https://github.com/qq1932121/LXR_CHNGroup",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "LXR": "[email protected]"
    },
    "source": {
        "git": "https://github.com/qq1932121/LXR_CHNGroup.git",
        "tag": "0.2.1"
    },
    "frameworks": "UIKit",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "LXR_CHNGroup/Classes/**/*"
}

Pin It on Pinterest

Share This