|
|
|
|
//
|
|
|
|
|
// PPGetAddressBook.h
|
|
|
|
|
// PPGetAddressBook
|
|
|
|
|
//
|
|
|
|
|
// Created by AndyPang on 16/8/17.
|
|
|
|
|
// Copyright © 2016年 AndyPang. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*********************************************************************************
|
|
|
|
|
*
|
|
|
|
|
*⭐️⭐️⭐️ 新建 PP-iOS学习交流群: 323408051 欢迎加入!!! ⭐️⭐️⭐️
|
|
|
|
|
*
|
|
|
|
|
* 如果您在使用 PPGetAddressBook 的过程中出现bug或有更好的建议,还请及时以下列方式联系我,我会及
|
|
|
|
|
* 时修复bug,解决问题.
|
|
|
|
|
*
|
|
|
|
|
* Weibo : jkpang-庞
|
|
|
|
|
* Email : jkpang@outlook.com
|
|
|
|
|
* QQ 群 : 323408051
|
|
|
|
|
* GitHub: https://github.com/jkpang
|
|
|
|
|
*
|
|
|
|
|
* PS:我的另外两个很好用的封装,欢迎使用!
|
|
|
|
|
* 1.对AFNetworking 3.x 与YYCache的二次封装,一句代码搞定数据请求与缓存,告别FMDB:
|
|
|
|
|
* GitHub:https://github.com/jkpang/PPNetworkHelper
|
|
|
|
|
* 2.仿京东淘宝商品数量的加减按钮,可定制程度高,使用简单:
|
|
|
|
|
* GitHub:https://github.com/jkpang/PPNumberButton
|
|
|
|
|
*
|
|
|
|
|
* 如果 PPGetAddressBook 好用,希望您能Star支持,你的 ⭐️ 是我持续更新的动力!
|
|
|
|
|
*********************************************************************************
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
#import "PPAddressBookHandle.h"
|
|
|
|
|
#import "PPPersonModel.h"
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取原始顺序的所有联系人的Block
|
|
|
|
|
*/
|
|
|
|
|
typedef void(^AddressBookArrayBlock)(NSArray<PPPersonModel *> *addressBookArray);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取按A~Z顺序排列的所有联系人的Block
|
|
|
|
|
*
|
|
|
|
|
* @param addressBookDict 装有所有联系人的字典->每个字典key对应装有多个联系人模型的数组->每个模型里面包含着用户的相关信息.
|
|
|
|
|
* @param peopleNameKey 联系人姓名的大写首字母的数组
|
|
|
|
|
*/
|
|
|
|
|
typedef void(^AddressBookDictBlock)(NSDictionary<NSString *,NSArray *> *addressBookDict,NSArray *nameKeys);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@interface PPGetAddressBook : NSObject
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 请求用户是否授权APP访问通讯录的权限,建议在APPDeletegate.m中的didFinishLaunchingWithOptions方法中调用
|
|
|
|
|
*/
|
|
|
|
|
+ (void)requestAddressBookAuthorization;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取原始顺序排列的所有联系人
|
|
|
|
|
*
|
|
|
|
|
* @param addressBookArray 装着原始顺序的联系人字典Block回调
|
|
|
|
|
*/
|
|
|
|
|
+ (void)getOriginalAddressBook:(AddressBookArrayBlock)addressBookArray authorizationFailure:(AuthorizationFailure)failure;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取按A~Z顺序排列的所有联系人
|
|
|
|
|
*
|
|
|
|
|
* @param addressBookInfo 装着A~Z排序的联系人字典Block回调
|
|
|
|
|
* @param failure 授权失败的Block
|
|
|
|
|
*/
|
|
|
|
|
+ (void)getOrderAddressBook:(AddressBookDictBlock)addressBookInfo authorizationFailure:(AuthorizationFailure)failure;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@end
|