测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | MIT |
发布最新版本 | 2015年12月 |
由 Jean Lebrument 维护。
依赖 | |
APAddressBook | >= 0 |
EasyMapping | >= 0 |
将 APContact 模型与 EasyMapping 简单地映射的类别
将以下三个库添加到你的 Podfile
中:
pod 'APAddressBook'
pod 'EasyMapping'
pod 'APContactEasyMapping'
添加以下包含内容:
#import <APAddressBook/AddressBook.h>
#import <EasyMapping/EasyMapping.h>
#import "APContact+EasyMapping.h"
示例
APAddressBook *addressBook = [[APAddressBook alloc] init];
addressBook.fieldsMask = APContactFieldAll;
[addressBook loadContacts:^(NSArray<APContact *> * _Nullable contacts, NSError * _Nullable error) {
NSMutableArray *serializedContacts = [NSMutableArray array];
for (APContact *contact in contacts) {
[serializedContacts addObject:[contact serializeToDictionary]];
}
}];