|
|
|
|
//
|
|
|
|
|
// PPDataHandle.h
|
|
|
|
|
// PPAddressBook
|
|
|
|
|
//
|
|
|
|
|
// 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>
|
|
|
|
|
|
|
|
|
|
#ifdef __IPHONE_9_0
|
|
|
|
|
#import <Contacts/Contacts.h>
|
|
|
|
|
#endif
|
|
|
|
|
#import <AddressBook/AddressBook.h>
|
|
|
|
|
|
|
|
|
|
#import "PPPersonModel.h"
|
|
|
|
|
#import "PPSingleton.h"
|
|
|
|
|
|
|
|
|
|
#define IOS9_LATER ([[UIDevice currentDevice] systemVersion].floatValue > 9.0 ? YES : NO )
|
|
|
|
|
|
|
|
|
|
/** 一个联系人的相关信息*/
|
|
|
|
|
typedef void(^PPPersonModelBlock)(PPPersonModel *model);
|
|
|
|
|
/** 授权失败的Block*/
|
|
|
|
|
typedef void(^AuthorizationFailure)(void);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@interface PPAddressBookHandle : NSObject
|
|
|
|
|
|
|
|
|
|
PPSingletonH(AddressBookHandle)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
请求用户通讯录授权
|
|
|
|
|
|
|
|
|
|
@param success 授权成功的回调
|
|
|
|
|
*/
|
|
|
|
|
- (void)requestAuthorizationWithSuccessBlock:(void(^)(void))success;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 返回每个联系人的模型
|
|
|
|
|
*
|
|
|
|
|
* @param personModel 单个联系人模型
|
|
|
|
|
* @param failure 授权失败的Block
|
|
|
|
|
*/
|
|
|
|
|
- (void)getAddressBookDataSource:(PPPersonModelBlock)personModel authorizationFailure:(AuthorizationFailure)failure;
|
|
|
|
|
|
|
|
|
|
@end
|