From aee193e0082d62bba4517f0b4c929ec5c70bd720 Mon Sep 17 00:00:00 2001 From: Alexey Belkevich Date: Tue, 22 Sep 2015 17:46:31 +0300 Subject: [PATCH] Refactored contact's data extacting --- .../AddressBook.xcodeproj/project.pbxproj | 170 +- .../AppIcon.appiconset/Contents.json | 5 + .../no_photo.imageset/Contents.json | 4 + .../AddressBook.xcodeproj/project.pbxproj | 1542 ++++++----------- .../AddressBook/Base.lproj/Main.storyboard | 4 +- .../Swift/AddressBook/ViewController.swift | 4 +- Example/Swift/Podfile.lock | 2 +- Pod/Core/Private/Builders/APContactBuilder.h | 2 +- Pod/Core/Private/Builders/APContactBuilder.m | 204 +-- .../Extractor/APContactDataExtractor.h | 27 + .../Extractor/APContactDataExtractor.m | 175 ++ .../Private/Helpers/APSocialServiceHelper.h | 16 + .../Private/Helpers/APSocialServiceHelper.m | 42 + .../Routine/APAddressBookContactsRoutine.m | 19 +- .../Private/Wrapper/APAddressBookRefWrapper.m | 17 +- Pod/Core/Public/Models/APAddress.h | 14 +- Pod/Core/Public/Models/APAddress.m | 16 - Pod/Core/Public/Models/APContact.h | 36 +- Pod/Core/Public/Models/APContact.m | 21 - Pod/Core/Public/Models/APPhoneWithLabel.h | 8 +- Pod/Core/Public/Models/APPhoneWithLabel.m | 14 - Pod/Core/Public/Models/APSocialProfile.h | 21 +- Pod/Core/Public/Models/APSocialProfile.m | 58 - Pod/Core/Public/Models/APTypes.h | 10 + 24 files changed, 1035 insertions(+), 1396 deletions(-) create mode 100644 Pod/Core/Private/Extractor/APContactDataExtractor.h create mode 100644 Pod/Core/Private/Extractor/APContactDataExtractor.m create mode 100644 Pod/Core/Private/Helpers/APSocialServiceHelper.h create mode 100644 Pod/Core/Private/Helpers/APSocialServiceHelper.m diff --git a/Example/Objective-C/AddressBook.xcodeproj/project.pbxproj b/Example/Objective-C/AddressBook.xcodeproj/project.pbxproj index 64e0791..ae8d072 100644 --- a/Example/Objective-C/AddressBook.xcodeproj/project.pbxproj +++ b/Example/Objective-C/AddressBook.xcodeproj/project.pbxproj @@ -7,19 +7,21 @@ objects = { /* Begin PBXBuildFile section */ + 2DBA109ADA77D63029C86512 /* APThread.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA125B051EE9D46F45C505 /* APThread.m */; }; + 2DBA10B2D79BB0AB645BCED5 /* APContactDataExtractor.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA153D432FAE772685E969 /* APContactDataExtractor.m */; }; 2DBA11BA759966D1EB552C67 /* APAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA10804A06D410681819BD /* APAddress.m */; }; 2DBA11BEDC2FD17137A8C852 /* APContact.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA14CA55A75A871C26C82F /* APContact.m */; }; - 2DBA1387024AE551F366651B /* APAddressBookBaseRoutine.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA188046D23F3E87C06E32 /* APAddressBookBaseRoutine.m */; }; - 2DBA16AC68AE7A1C4BC965D0 /* APAddressBookExternalChangeRoutine.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1AE7B78E62727AC24B8E /* APAddressBookExternalChangeRoutine.m */; }; - 2DBA16D58F1DE05E4754EFC7 /* APAddressBookAccessRoutine.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1A0BE0B76140D1290AEA /* APAddressBookAccessRoutine.m */; }; - 2DBA17F4EF0FFF28C61A008B /* APThread.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA19F412AD86EA33259633 /* APThread.m */; }; - 2DBA1A31FBD0315AB086CA73 /* APContactBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA11206A579079E59F2695 /* APContactBuilder.m */; }; - 2DBA1A3CD4061547F5138692 /* NSArray+APAddressBook.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1196CDD5245AC33DE9AD /* NSArray+APAddressBook.m */; }; - 2DBA1AE11F21966F310307EB /* APAddressBookContactsRoutine.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA17A4A7B7EA8872870962 /* APAddressBookContactsRoutine.m */; }; - 2DBA1CA49C3A86F1B25376A9 /* APAddressBookRefWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1F56C4DEF9D30603355C /* APAddressBookRefWrapper.m */; }; + 2DBA12ED1646227C60CFEB8A /* APSocialServiceHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1D50E367D26256BF6ACE /* APSocialServiceHelper.m */; }; + 2DBA1353F6D48E61D8FE52E9 /* APAddressBookAccessRoutine.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA12274B8BFA605F110B91 /* APAddressBookAccessRoutine.m */; }; + 2DBA137D3076D6E6FC78ABB9 /* APContactBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA10055B7C4CA15B752EE5 /* APContactBuilder.m */; }; + 2DBA18FC2FF7F4AE18208C23 /* APAddressBookBaseRoutine.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA14AE247588EB09FCB705 /* APAddressBookBaseRoutine.m */; }; + 2DBA1A57B40D47C26F1FC2EA /* NSArray+APAddressBook.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA163CB64937C13056022E /* NSArray+APAddressBook.m */; }; + 2DBA1B499F669F228CB6B1AE /* APAddressBookExternalChangeRoutine.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA15D1186A313346545E82 /* APAddressBookExternalChangeRoutine.m */; }; + 2DBA1C26ABD2B795F598BD28 /* APAddressBookContactsRoutine.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA158EF117E2D3DBBB673B /* APAddressBookContactsRoutine.m */; }; 2DBA1CB4F69E60CE1F9C0242 /* APAddressBook.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA12DDF7D558CB7281DF82 /* APAddressBook.m */; }; 2DBA1D30942122FA3D996574 /* APSocialProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1825CB9083C503993480 /* APSocialProfile.m */; }; 2DBA1DD363A02B334F88A6A6 /* APPhoneWithLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1AB470DEA08ACCE65F4A /* APPhoneWithLabel.m */; }; + 2DBA1F30EEC9391D5B7D837B /* APAddressBookRefWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1CE66C6D93542A66D6CC /* APAddressBookRefWrapper.m */; }; A495CDF35F214F43AFF3AAF9 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6084C3D31A504C79BEA08B84 /* libPods.a */; }; FA66281C187FE9EF00667C81 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA66281B187FE9EF00667C81 /* Foundation.framework */; }; FA66281E187FE9EF00667C81 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA66281D187FE9EF00667C81 /* CoreGraphics.framework */; }; @@ -36,34 +38,38 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 2DBA10055B7C4CA15B752EE5 /* APContactBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APContactBuilder.m; sourceTree = ""; }; 2DBA10804A06D410681819BD /* APAddress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddress.m; sourceTree = ""; }; - 2DBA11206A579079E59F2695 /* APContactBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APContactBuilder.m; sourceTree = ""; }; - 2DBA11341EB34E4C9157C467 /* NSArray+APAddressBook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+APAddressBook.h"; sourceTree = ""; }; - 2DBA1196CDD5245AC33DE9AD /* NSArray+APAddressBook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+APAddressBook.m"; sourceTree = ""; }; + 2DBA11586D1BD36B84E8D9B0 /* APAddressBookAccessRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookAccessRoutine.h; sourceTree = ""; }; + 2DBA11E92C0A7C2973BD787B /* NSArray+APAddressBook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+APAddressBook.h"; sourceTree = ""; }; + 2DBA12274B8BFA605F110B91 /* APAddressBookAccessRoutine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookAccessRoutine.m; sourceTree = ""; }; + 2DBA125B051EE9D46F45C505 /* APThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APThread.m; sourceTree = ""; }; 2DBA12CDF576C49EAEB83108 /* APPhoneWithLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APPhoneWithLabel.h; sourceTree = ""; }; 2DBA12DDF7D558CB7281DF82 /* APAddressBook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBook.m; sourceTree = ""; }; 2DBA131ED390B35AF6A6F826 /* APAddressBook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBook.h; sourceTree = ""; }; - 2DBA136C7C8FF0467D706C14 /* APAddressBookAccessRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookAccessRoutine.h; sourceTree = ""; }; - 2DBA1438EC5B589FBE899F88 /* APContactBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APContactBuilder.h; sourceTree = ""; }; + 2DBA139B1186C6628062F238 /* APThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APThread.h; sourceTree = ""; }; + 2DBA14AE247588EB09FCB705 /* APAddressBookBaseRoutine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookBaseRoutine.m; sourceTree = ""; }; 2DBA14CA55A75A871C26C82F /* APContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APContact.m; sourceTree = ""; }; + 2DBA153D432FAE772685E969 /* APContactDataExtractor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APContactDataExtractor.m; sourceTree = ""; }; + 2DBA158EF117E2D3DBBB673B /* APAddressBookContactsRoutine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookContactsRoutine.m; sourceTree = ""; }; + 2DBA15A68FC48C856C3091A4 /* APAddressBookContactsRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookContactsRoutine.h; sourceTree = ""; }; + 2DBA15D1186A313346545E82 /* APAddressBookExternalChangeRoutine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookExternalChangeRoutine.m; sourceTree = ""; }; 2DBA161642CBB5F0613EABC7 /* APTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APTypes.h; sourceTree = ""; }; + 2DBA163CB64937C13056022E /* NSArray+APAddressBook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+APAddressBook.m"; sourceTree = ""; }; 2DBA16AB38312AA9DDBD1F1F /* APAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddress.h; sourceTree = ""; }; - 2DBA16B08903C288CE51B171 /* APAddressBookExternalChangeRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookExternalChangeRoutine.h; sourceTree = ""; }; - 2DBA170453898735127CFBB7 /* APAddressBookContactsRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookContactsRoutine.h; sourceTree = ""; }; - 2DBA17A4A7B7EA8872870962 /* APAddressBookContactsRoutine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookContactsRoutine.m; sourceTree = ""; }; 2DBA1825CB9083C503993480 /* APSocialProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APSocialProfile.m; sourceTree = ""; }; - 2DBA188046D23F3E87C06E32 /* APAddressBookBaseRoutine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookBaseRoutine.m; sourceTree = ""; }; - 2DBA189EB8C378B448163858 /* APAddressBookRefWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookRefWrapper.h; sourceTree = ""; }; 2DBA19846B6F2A33EDA67564 /* APContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APContact.h; sourceTree = ""; }; - 2DBA19F412AD86EA33259633 /* APThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APThread.m; sourceTree = ""; }; - 2DBA1A0BE0B76140D1290AEA /* APAddressBookAccessRoutine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookAccessRoutine.m; sourceTree = ""; }; + 2DBA1A1320B550F8D7A58ED9 /* APAddressBookRefWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookRefWrapper.h; sourceTree = ""; }; + 2DBA1A4059663C23270F830C /* APAddressBookExternalChangeDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookExternalChangeDelegate.h; sourceTree = ""; }; 2DBA1AB470DEA08ACCE65F4A /* APPhoneWithLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APPhoneWithLabel.m; sourceTree = ""; }; - 2DBA1AE7B78E62727AC24B8E /* APAddressBookExternalChangeRoutine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookExternalChangeRoutine.m; sourceTree = ""; }; + 2DBA1AB6C60DBBA93605DCBF /* APAddressBookExternalChangeRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookExternalChangeRoutine.h; sourceTree = ""; }; + 2DBA1ABCD1751A594F2325F5 /* APSocialServiceHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APSocialServiceHelper.h; sourceTree = ""; }; + 2DBA1C3F544E35966C2A46A3 /* APContactDataExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APContactDataExtractor.h; sourceTree = ""; }; 2DBA1C455F191115437B4108 /* APSocialProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APSocialProfile.h; sourceTree = ""; }; - 2DBA1C709D800C9AD2FE62FD /* APAddressBookBaseRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookBaseRoutine.h; sourceTree = ""; }; - 2DBA1EBA78D601335D497A46 /* APAddressBookExternalChangeDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookExternalChangeDelegate.h; sourceTree = ""; }; - 2DBA1F56C4DEF9D30603355C /* APAddressBookRefWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookRefWrapper.m; sourceTree = ""; }; - 2DBA1FA140934AD39CC7A39C /* APThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APThread.h; sourceTree = ""; }; + 2DBA1CAE20F58C7157F9C097 /* APAddressBookBaseRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookBaseRoutine.h; sourceTree = ""; }; + 2DBA1CE66C6D93542A66D6CC /* APAddressBookRefWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookRefWrapper.m; sourceTree = ""; }; + 2DBA1D50E367D26256BF6ACE /* APSocialServiceHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APSocialServiceHelper.m; sourceTree = ""; }; + 2DBA1DD07C5A43B4DD3EA17A /* APContactBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APContactBuilder.h; sourceTree = ""; }; 6084C3D31A504C79BEA08B84 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 6496F61BD33753BB99E0AB3D /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 8DB33874E6CEAEB5C3CAD23B /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; @@ -103,6 +109,30 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 2DBA107CC34835F556CCBB80 /* Base */ = { + isa = PBXGroup; + children = ( + 2DBA14AE247588EB09FCB705 /* APAddressBookBaseRoutine.m */, + 2DBA1CAE20F58C7157F9C097 /* APAddressBookBaseRoutine.h */, + ); + path = Base; + sourceTree = ""; + }; + 2DBA108E06803BCF75116A5F /* Routine */ = { + isa = PBXGroup; + children = ( + 2DBA12274B8BFA605F110B91 /* APAddressBookAccessRoutine.m */, + 2DBA11586D1BD36B84E8D9B0 /* APAddressBookAccessRoutine.h */, + 2DBA158EF117E2D3DBBB673B /* APAddressBookContactsRoutine.m */, + 2DBA15A68FC48C856C3091A4 /* APAddressBookContactsRoutine.h */, + 2DBA107CC34835F556CCBB80 /* Base */, + 2DBA15D1186A313346545E82 /* APAddressBookExternalChangeRoutine.m */, + 2DBA1AB6C60DBBA93605DCBF /* APAddressBookExternalChangeRoutine.h */, + 2DBA1A4059663C23270F830C /* APAddressBookExternalChangeDelegate.h */, + ); + path = Routine; + sourceTree = ""; + }; 2DBA10BE344091385DF53A32 /* Public */ = { isa = PBXGroup; children = ( @@ -113,67 +143,63 @@ path = Public; sourceTree = ""; }; - 2DBA112C0378D7B7D3BBC388 /* Thread */ = { + 2DBA1318F898D71A0C32328C /* Categories */ = { isa = PBXGroup; children = ( - 2DBA1FA140934AD39CC7A39C /* APThread.h */, - 2DBA19F412AD86EA33259633 /* APThread.m */, + 2DBA163CB64937C13056022E /* NSArray+APAddressBook.m */, + 2DBA11E92C0A7C2973BD787B /* NSArray+APAddressBook.h */, ); - path = Thread; + path = Categories; sourceTree = ""; }; - 2DBA117066AB2A0303681812 /* Categories */ = { + 2DBA1693A4961B92662AFC34 /* Private */ = { isa = PBXGroup; children = ( - 2DBA1196CDD5245AC33DE9AD /* NSArray+APAddressBook.m */, - 2DBA11341EB34E4C9157C467 /* NSArray+APAddressBook.h */, + 2DBA1FC53B035268B93DC674 /* Thread */, + 2DBA108E06803BCF75116A5F /* Routine */, + 2DBA1A42129A602812F4B4E8 /* Builders */, + 2DBA1705BC593F92C1870534 /* Wrapper */, + 2DBA1318F898D71A0C32328C /* Categories */, + 2DBA17FB82D91E188A92BA0E /* Extractor */, + 2DBA18B5003E6C7FB8A14478 /* Helpers */, ); - path = Categories; + path = Private; sourceTree = ""; }; - 2DBA17185CB94990CBF52F5E /* Builders */ = { + 2DBA1705BC593F92C1870534 /* Wrapper */ = { isa = PBXGroup; children = ( - 2DBA1438EC5B589FBE899F88 /* APContactBuilder.h */, - 2DBA11206A579079E59F2695 /* APContactBuilder.m */, + 2DBA1CE66C6D93542A66D6CC /* APAddressBookRefWrapper.m */, + 2DBA1A1320B550F8D7A58ED9 /* APAddressBookRefWrapper.h */, ); - path = Builders; + path = Wrapper; sourceTree = ""; }; - 2DBA190CE71772B851340885 /* Routine */ = { + 2DBA17FB82D91E188A92BA0E /* Extractor */ = { isa = PBXGroup; children = ( - 2DBA1A0BE0B76140D1290AEA /* APAddressBookAccessRoutine.m */, - 2DBA136C7C8FF0467D706C14 /* APAddressBookAccessRoutine.h */, - 2DBA17A4A7B7EA8872870962 /* APAddressBookContactsRoutine.m */, - 2DBA170453898735127CFBB7 /* APAddressBookContactsRoutine.h */, - 2DBA1FD8FF9E5F093B5CC139 /* Base */, - 2DBA1AE7B78E62727AC24B8E /* APAddressBookExternalChangeRoutine.m */, - 2DBA16B08903C288CE51B171 /* APAddressBookExternalChangeRoutine.h */, - 2DBA1EBA78D601335D497A46 /* APAddressBookExternalChangeDelegate.h */, + 2DBA153D432FAE772685E969 /* APContactDataExtractor.m */, + 2DBA1C3F544E35966C2A46A3 /* APContactDataExtractor.h */, ); - path = Routine; + path = Extractor; sourceTree = ""; }; - 2DBA195D1571CEBB712DE325 /* Wrapper */ = { + 2DBA18B5003E6C7FB8A14478 /* Helpers */ = { isa = PBXGroup; children = ( - 2DBA1F56C4DEF9D30603355C /* APAddressBookRefWrapper.m */, - 2DBA189EB8C378B448163858 /* APAddressBookRefWrapper.h */, + 2DBA1ABCD1751A594F2325F5 /* APSocialServiceHelper.h */, + 2DBA1D50E367D26256BF6ACE /* APSocialServiceHelper.m */, ); - path = Wrapper; + path = Helpers; sourceTree = ""; }; - 2DBA1A642E331100BFC32184 /* Private */ = { + 2DBA1A42129A602812F4B4E8 /* Builders */ = { isa = PBXGroup; children = ( - 2DBA112C0378D7B7D3BBC388 /* Thread */, - 2DBA190CE71772B851340885 /* Routine */, - 2DBA17185CB94990CBF52F5E /* Builders */, - 2DBA195D1571CEBB712DE325 /* Wrapper */, - 2DBA117066AB2A0303681812 /* Categories */, + 2DBA1DD07C5A43B4DD3EA17A /* APContactBuilder.h */, + 2DBA10055B7C4CA15B752EE5 /* APContactBuilder.m */, ); - path = Private; + path = Builders; sourceTree = ""; }; 2DBA1D06B4967106F9C2BFBC /* Models */ = { @@ -192,13 +218,13 @@ path = Models; sourceTree = ""; }; - 2DBA1FD8FF9E5F093B5CC139 /* Base */ = { + 2DBA1FC53B035268B93DC674 /* Thread */ = { isa = PBXGroup; children = ( - 2DBA188046D23F3E87C06E32 /* APAddressBookBaseRoutine.m */, - 2DBA1C709D800C9AD2FE62FD /* APAddressBookBaseRoutine.h */, + 2DBA139B1186C6628062F238 /* APThread.h */, + 2DBA125B051EE9D46F45C505 /* APThread.m */, ); - path = Base; + path = Thread; sourceTree = ""; }; B1E097FCAF3383FBD1C698F2 /* Pods */ = { @@ -329,8 +355,8 @@ FAB405A1199E5F2000E8E62D /* Core */ = { isa = PBXGroup; children = ( - 2DBA1A642E331100BFC32184 /* Private */, 2DBA10BE344091385DF53A32 /* Public */, + 2DBA1693A4961B92662AFC34 /* Private */, ); path = Core; sourceTree = ""; @@ -444,14 +470,16 @@ 2DBA11BEDC2FD17137A8C852 /* APContact.m in Sources */, 2DBA1DD363A02B334F88A6A6 /* APPhoneWithLabel.m in Sources */, 2DBA1D30942122FA3D996574 /* APSocialProfile.m in Sources */, - 2DBA17F4EF0FFF28C61A008B /* APThread.m in Sources */, - 2DBA16D58F1DE05E4754EFC7 /* APAddressBookAccessRoutine.m in Sources */, - 2DBA1AE11F21966F310307EB /* APAddressBookContactsRoutine.m in Sources */, - 2DBA1A31FBD0315AB086CA73 /* APContactBuilder.m in Sources */, - 2DBA1CA49C3A86F1B25376A9 /* APAddressBookRefWrapper.m in Sources */, - 2DBA1387024AE551F366651B /* APAddressBookBaseRoutine.m in Sources */, - 2DBA16AC68AE7A1C4BC965D0 /* APAddressBookExternalChangeRoutine.m in Sources */, - 2DBA1A3CD4061547F5138692 /* NSArray+APAddressBook.m in Sources */, + 2DBA109ADA77D63029C86512 /* APThread.m in Sources */, + 2DBA1353F6D48E61D8FE52E9 /* APAddressBookAccessRoutine.m in Sources */, + 2DBA1C26ABD2B795F598BD28 /* APAddressBookContactsRoutine.m in Sources */, + 2DBA18FC2FF7F4AE18208C23 /* APAddressBookBaseRoutine.m in Sources */, + 2DBA1B499F669F228CB6B1AE /* APAddressBookExternalChangeRoutine.m in Sources */, + 2DBA137D3076D6E6FC78ABB9 /* APContactBuilder.m in Sources */, + 2DBA1F30EEC9391D5B7D837B /* APAddressBookRefWrapper.m in Sources */, + 2DBA1A57B40D47C26F1FC2EA /* NSArray+APAddressBook.m in Sources */, + 2DBA10B2D79BB0AB645BCED5 /* APContactDataExtractor.m in Sources */, + 2DBA12ED1646227C60CFEB8A /* APSocialServiceHelper.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Example/Objective-C/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/Objective-C/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json index a396706..33ec0bc 100644 --- a/Example/Objective-C/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Example/Objective-C/AddressBook/Images.xcassets/AppIcon.appiconset/Contents.json @@ -14,6 +14,11 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" } ], "info" : { diff --git a/Example/Objective-C/AddressBook/Images.xcassets/no_photo.imageset/Contents.json b/Example/Objective-C/AddressBook/Images.xcassets/no_photo.imageset/Contents.json index dbc32db..2e2469b 100644 --- a/Example/Objective-C/AddressBook/Images.xcassets/no_photo.imageset/Contents.json +++ b/Example/Objective-C/AddressBook/Images.xcassets/no_photo.imageset/Contents.json @@ -9,6 +9,10 @@ "idiom" : "universal", "scale" : "2x", "filename" : "no_photo@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x" } ], "info" : { diff --git a/Example/Swift/AddressBook.xcodeproj/project.pbxproj b/Example/Swift/AddressBook.xcodeproj/project.pbxproj index e580329..93988fe 100644 --- a/Example/Swift/AddressBook.xcodeproj/project.pbxproj +++ b/Example/Swift/AddressBook.xcodeproj/project.pbxproj @@ -1,982 +1,560 @@ - - - - - archiveVersion - 1 - classes - - objectVersion - 46 - objects - - 33F0520C9FDA49DCA3BB9D9C - - buildActionMask - 2147483647 - files - - inputPaths - - isa - PBXShellScriptBuildPhase - name - Check Pods Manifest.lock - outputPaths - - runOnlyForDeploymentPostprocessing - 0 - shellPath - /bin/sh - shellScript - diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null -if [[ $? != 0 ]] ; then - cat << EOM -error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. -EOM - exit 1 -fi - - showEnvVarsInLog - 0 - - 4845391491E59C918D93E784 - - children - - C119F157280640CA31CD4E27 - 66F112F4D42891A3F34E4113 - - isa - PBXGroup - name - Pods - sourceTree - <group> - - 65E3953D9FB24ACD81049105 - - children - - E7E250D68A454F4989DC2929 - - isa - PBXGroup - name - Frameworks - sourceTree - <group> - - 66F112F4D42891A3F34E4113 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - name - Pods.release.xcconfig - path - Pods/Target Support Files/Pods/Pods.release.xcconfig - sourceTree - <group> - - AC7C9DDD497D46C0BC5090E1 - - fileRef - E7E250D68A454F4989DC2929 - isa - PBXBuildFile - - B2898E40613B4BB0A854A658 - - buildActionMask - 2147483647 - files - - inputPaths - - isa - PBXShellScriptBuildPhase - name - Copy Pods Resources - outputPaths - - runOnlyForDeploymentPostprocessing - 0 - shellPath - /bin/sh - shellScript - "${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh" - - showEnvVarsInLog - 0 - - C119F157280640CA31CD4E27 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text.xcconfig - name - Pods.debug.xcconfig - path - Pods/Target Support Files/Pods/Pods.debug.xcconfig - sourceTree - <group> - - E7E250D68A454F4989DC2929 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods.a - sourceTree - BUILT_PRODUCTS_DIR - - FA3B9847198AB4CC005953CE - - children - - FACA8344198AB2FD0059676C - - isa - PBXGroup - name - AppDelegate - sourceTree - <group> - - FA3B9848198AB4D4005953CE - - children - - FACA8346198AB2FD0059676C - FACA8348198AB2FD0059676C - - isa - PBXGroup - name - Controllers - sourceTree - <group> - - FA3B984A198AB8C2005953CE - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Bridging.h - sourceTree - <group> - - FA3B984B198ABBB5005953CE - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.swift - path - TableViewCell.swift - sourceTree - <group> - - FA3B984C198ABBB5005953CE - - fileRef - FA3B984B198ABBB5005953CE - isa - PBXBuildFile - - FA3B984D198ABBBA005953CE - - children - - FA3B984B198ABBB5005953CE - - isa - PBXGroup - name - Views - sourceTree - <group> - - FACA8336198AB2FD0059676C - - children - - FAE3963E199E6150004276D3 - FACA8341198AB2FD0059676C - FACA8340198AB2FD0059676C - 65E3953D9FB24ACD81049105 - 4845391491E59C918D93E784 - - isa - PBXGroup - sourceTree - <group> - - FACA8337198AB2FD0059676C - - attributes - - LastUpgradeCheck - 0600 - ORGANIZATIONNAME - alterplay - TargetAttributes - - FACA833E198AB2FD0059676C - - CreatedOnToolsVersion - 6.0 - - - - buildConfigurationList - FACA833A198AB2FD0059676C - compatibilityVersion - Xcode 3.2 - developmentRegion - English - hasScannedForEncodings - 0 - isa - PBXProject - knownRegions - - en - Base - - mainGroup - FACA8336198AB2FD0059676C - productRefGroup - FACA8340198AB2FD0059676C - projectDirPath - - projectReferences - - projectRoot - - targets - - FACA833E198AB2FD0059676C - - - FACA833A198AB2FD0059676C - - buildConfigurations - - FACA8359198AB2FD0059676C - FACA835A198AB2FD0059676C - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - FACA833B198AB2FD0059676C - - buildActionMask - 2147483647 - files - - FACA8347198AB2FD0059676C - FAE39651199E6150004276D3 - FAE3964E199E6150004276D3 - FAE3964D199E6150004276D3 - FAE3964F199E6150004276D3 - FA3B984C198ABBB5005953CE - FAE39650199E6150004276D3 - FACA8345198AB2FD0059676C - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - FACA833C198AB2FD0059676C - - buildActionMask - 2147483647 - files - - AC7C9DDD497D46C0BC5090E1 - - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - FACA833D198AB2FD0059676C - - buildActionMask - 2147483647 - files - - FACA834A198AB2FD0059676C - FACA834C198AB2FD0059676C - - isa - PBXResourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - FACA833E198AB2FD0059676C - - buildConfigurationList - FACA835B198AB2FD0059676C - buildPhases - - 33F0520C9FDA49DCA3BB9D9C - FACA833B198AB2FD0059676C - FACA833C198AB2FD0059676C - FACA833D198AB2FD0059676C - B2898E40613B4BB0A854A658 - - buildRules - - dependencies - - isa - PBXNativeTarget - name - AddressBook - productName - AddressBook - productReference - FACA833F198AB2FD0059676C - productType - com.apple.product-type.application - - FACA833F198AB2FD0059676C - - explicitFileType - wrapper.application - includeInIndex - 0 - isa - PBXFileReference - path - AddressBook.app - sourceTree - BUILT_PRODUCTS_DIR - - FACA8340198AB2FD0059676C - - children - - FACA833F198AB2FD0059676C - - isa - PBXGroup - name - Products - sourceTree - <group> - - FACA8341198AB2FD0059676C - - children - - FA3B9848198AB4D4005953CE - FA3B984D198ABBBA005953CE - FA3B9847198AB4CC005953CE - FACA834B198AB2FD0059676C - FACA8342198AB2FD0059676C - - isa - PBXGroup - path - AddressBook - sourceTree - <group> - - FACA8342198AB2FD0059676C - - children - - FA3B984A198AB8C2005953CE - FACA8343198AB2FD0059676C - - isa - PBXGroup - name - Supporting Files - sourceTree - <group> - - FACA8343198AB2FD0059676C - - isa - PBXFileReference - lastKnownFileType - text.plist.xml - path - Info.plist - sourceTree - <group> - - FACA8344198AB2FD0059676C - - isa - PBXFileReference - lastKnownFileType - sourcecode.swift - path - AppDelegate.swift - sourceTree - <group> - - FACA8345198AB2FD0059676C - - fileRef - FACA8344198AB2FD0059676C - isa - PBXBuildFile - - FACA8346198AB2FD0059676C - - isa - PBXFileReference - lastKnownFileType - sourcecode.swift - path - ViewController.swift - sourceTree - <group> - - FACA8347198AB2FD0059676C - - fileRef - FACA8346198AB2FD0059676C - isa - PBXBuildFile - - FACA8348198AB2FD0059676C - - children - - FACA8349198AB2FD0059676C - - isa - PBXVariantGroup - name - Main.storyboard - sourceTree - <group> - - FACA8349198AB2FD0059676C - - isa - PBXFileReference - lastKnownFileType - file.storyboard - name - Base - path - Base.lproj/Main.storyboard - sourceTree - <group> - - FACA834A198AB2FD0059676C - - fileRef - FACA8348198AB2FD0059676C - isa - PBXBuildFile - - FACA834B198AB2FD0059676C - - isa - PBXFileReference - lastKnownFileType - folder.assetcatalog - path - Images.xcassets - sourceTree - <group> - - FACA834C198AB2FD0059676C - - fileRef - FACA834B198AB2FD0059676C - isa - PBXBuildFile - - FACA8359198AB2FD0059676C - - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_CXX_LIBRARY - libc++ - CLANG_ENABLE_MODULES - YES - CLANG_ENABLE_OBJC_ARC - YES - CLANG_WARN_BOOL_CONVERSION - YES - CLANG_WARN_CONSTANT_CONVERSION - YES - CLANG_WARN_DIRECT_OBJC_ISA_USAGE - YES_ERROR - CLANG_WARN_EMPTY_BODY - YES - CLANG_WARN_ENUM_CONVERSION - YES - CLANG_WARN_INT_CONVERSION - YES - CLANG_WARN_OBJC_ROOT_CLASS - YES_ERROR - CLANG_WARN_UNREACHABLE_CODE - YES - CLANG_WARN__DUPLICATE_METHOD_MATCH - YES - CODE_SIGN_IDENTITY[sdk=iphoneos*] - iPhone Developer - COPY_PHASE_STRIP - NO - ENABLE_STRICT_OBJC_MSGSEND - YES - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - GCC_WARN_64_TO_32_BIT_CONVERSION - YES - GCC_WARN_ABOUT_RETURN_TYPE - YES_ERROR - GCC_WARN_UNDECLARED_SELECTOR - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES_AGGRESSIVE - GCC_WARN_UNUSED_FUNCTION - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 8.0 - MTL_ENABLE_DEBUG_INFO - YES - ONLY_ACTIVE_ARCH - YES - SDKROOT - iphoneos - SWIFT_OPTIMIZATION_LEVEL - -Onone - - isa - XCBuildConfiguration - name - Debug - - FACA835A198AB2FD0059676C - - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_CXX_LIBRARY - libc++ - CLANG_ENABLE_MODULES - YES - CLANG_ENABLE_OBJC_ARC - YES - CLANG_WARN_BOOL_CONVERSION - YES - CLANG_WARN_CONSTANT_CONVERSION - YES - CLANG_WARN_DIRECT_OBJC_ISA_USAGE - YES_ERROR - CLANG_WARN_EMPTY_BODY - YES - CLANG_WARN_ENUM_CONVERSION - YES - CLANG_WARN_INT_CONVERSION - YES - CLANG_WARN_OBJC_ROOT_CLASS - YES_ERROR - CLANG_WARN_UNREACHABLE_CODE - YES - CLANG_WARN__DUPLICATE_METHOD_MATCH - YES - CODE_SIGN_IDENTITY[sdk=iphoneos*] - iPhone Developer - COPY_PHASE_STRIP - YES - ENABLE_NS_ASSERTIONS - NO - ENABLE_STRICT_OBJC_MSGSEND - YES - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_WARN_64_TO_32_BIT_CONVERSION - YES - GCC_WARN_ABOUT_RETURN_TYPE - YES_ERROR - GCC_WARN_UNDECLARED_SELECTOR - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES_AGGRESSIVE - GCC_WARN_UNUSED_FUNCTION - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 8.0 - MTL_ENABLE_DEBUG_INFO - NO - SDKROOT - iphoneos - VALIDATE_PRODUCT - YES - - isa - XCBuildConfiguration - name - Release - - FACA835B198AB2FD0059676C - - buildConfigurations - - FACA835C198AB2FD0059676C - FACA835D198AB2FD0059676C - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - - FACA835C198AB2FD0059676C - - baseConfigurationReference - C119F157280640CA31CD4E27 - buildSettings - - ASSETCATALOG_COMPILER_APPICON_NAME - AppIcon - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME - LaunchImage - INFOPLIST_FILE - AddressBook/Info.plist - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - LD_RUNPATH_SEARCH_PATHS - $(inherited) @executable_path/Frameworks - PRODUCT_NAME - $(TARGET_NAME) - SWIFT_OBJC_BRIDGING_HEADER - AddressBook/Bridging.h - - isa - XCBuildConfiguration - name - Debug - - FACA835D198AB2FD0059676C - - baseConfigurationReference - 66F112F4D42891A3F34E4113 - buildSettings - - ASSETCATALOG_COMPILER_APPICON_NAME - AppIcon - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME - LaunchImage - INFOPLIST_FILE - AddressBook/Info.plist - IPHONEOS_DEPLOYMENT_TARGET - 7.0 - LD_RUNPATH_SEARCH_PATHS - $(inherited) @executable_path/Frameworks - PRODUCT_NAME - $(TARGET_NAME) - SWIFT_OBJC_BRIDGING_HEADER - AddressBook/Bridging.h - - isa - XCBuildConfiguration - name - Release - - FAE3963E199E6150004276D3 - - children - - FAE3963F199E6150004276D3 - FAE3964B199E6150004276D3 - - isa - PBXGroup - name - Pod - path - ../../Pod - sourceTree - <group> - - FAE3963F199E6150004276D3 - - children - - FAE39640199E6150004276D3 - FAE39641199E6150004276D3 - FAE39642199E6150004276D3 - FAE39643199E6150004276D3 - FAE39644199E6150004276D3 - FAE39645199E6150004276D3 - FAE39646199E6150004276D3 - FAE39647199E6150004276D3 - FAE39648199E6150004276D3 - FAE39649199E6150004276D3 - FAE3964A199E6150004276D3 - - isa - PBXGroup - path - Core - sourceTree - <group> - - FAE39640199E6150004276D3 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - APAddress.h - sourceTree - <group> - - FAE39641199E6150004276D3 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - APAddress.m - sourceTree - <group> - - FAE39642199E6150004276D3 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - APAddressBook.h - sourceTree - <group> - - FAE39643199E6150004276D3 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - APAddressBook.m - sourceTree - <group> - - FAE39644199E6150004276D3 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - APContact.h - sourceTree - <group> - - FAE39645199E6150004276D3 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - APContact.m - sourceTree - <group> - - FAE39646199E6150004276D3 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - APPhoneWithLabel.h - sourceTree - <group> - - FAE39647199E6150004276D3 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - APPhoneWithLabel.m - sourceTree - <group> - - FAE39648199E6150004276D3 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - APSocialProfile.h - sourceTree - <group> - - FAE39649199E6150004276D3 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - APSocialProfile.m - sourceTree - <group> - - FAE3964A199E6150004276D3 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - APTypes.h - sourceTree - <group> - - FAE3964B199E6150004276D3 - - children - - FAE3964C199E6150004276D3 - - isa - PBXGroup - path - Swift - sourceTree - <group> - - FAE3964C199E6150004276D3 - - fileEncoding - 4 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - APAddressBook-Bridging.h - sourceTree - <group> - - FAE3964D199E6150004276D3 - - fileRef - FAE39641199E6150004276D3 - isa - PBXBuildFile - - FAE3964E199E6150004276D3 - - fileRef - FAE39643199E6150004276D3 - isa - PBXBuildFile - - FAE3964F199E6150004276D3 - - fileRef - FAE39645199E6150004276D3 - isa - PBXBuildFile - - FAE39650199E6150004276D3 - - fileRef - FAE39647199E6150004276D3 - isa - PBXBuildFile - - FAE39651199E6150004276D3 - - fileRef - FAE39649199E6150004276D3 - isa - PBXBuildFile - - - rootObject - FACA8337198AB2FD0059676C - - +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 2DBA109CD7D77BFADB550567 /* APSocialProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1CCDBC03A68030EE8E77 /* APSocialProfile.m */; }; + 2DBA10EBE7BD7100D56F72FF /* APContactBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1AA1E14E68E764EC5F97 /* APContactBuilder.m */; }; + 2DBA12DBFBB704807665A12B /* APAddress.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA10262649476BA9146580 /* APAddress.m */; }; + 2DBA1567014634F6777E18EC /* APAddressBookRefWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA178048ED0F22E391EBDA /* APAddressBookRefWrapper.m */; }; + 2DBA1583992FF8028413D0E9 /* APAddressBookAccessRoutine.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1DCD87EF12456C78A9A5 /* APAddressBookAccessRoutine.m */; }; + 2DBA158CA5FC69C94F759FC4 /* APPhoneWithLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA17272868178AC43272AD /* APPhoneWithLabel.m */; }; + 2DBA1A725FC4FA075E5F160D /* NSArray+APAddressBook.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1AB1EBAD5D9F41F65BAB /* NSArray+APAddressBook.m */; }; + 2DBA1B304136013C113208AF /* APAddressBookContactsRoutine.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA11B0EC619BED683F6711 /* APAddressBookContactsRoutine.m */; }; + 2DBA1CC57636698E29AA4DD2 /* APAddressBook.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA137DA1598E265ED8840C /* APAddressBook.m */; }; + 2DBA1CCACA567202FE258B22 /* APThread.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA166BA5DC5DE339DD66CC /* APThread.m */; }; + 2DBA1EB91583F7F331983105 /* APAddressBookExternalChangeRoutine.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1227B13567F25214F8D0 /* APAddressBookExternalChangeRoutine.m */; }; + 2DBA1F350A6F2D748B83886D /* APContact.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA136BD7C11DDC5F071275 /* APContact.m */; }; + 2DBA1F9D6F4E3ABEA593AC81 /* APAddressBookBaseRoutine.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DBA1287DEC3F992050F887B /* APAddressBookBaseRoutine.m */; }; + AC7C9DDD497D46C0BC5090E1 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E250D68A454F4989DC2929 /* libPods.a */; }; + FA3B984C198ABBB5005953CE /* TableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA3B984B198ABBB5005953CE /* TableViewCell.swift */; }; + FACA8345198AB2FD0059676C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FACA8344198AB2FD0059676C /* AppDelegate.swift */; }; + FACA8347198AB2FD0059676C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = FACA8346198AB2FD0059676C /* ViewController.swift */; }; + FACA834A198AB2FD0059676C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FACA8348198AB2FD0059676C /* Main.storyboard */; }; + FACA834C198AB2FD0059676C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FACA834B198AB2FD0059676C /* Images.xcassets */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 2DBA10262649476BA9146580 /* APAddress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddress.m; sourceTree = ""; }; + 2DBA10FDA9851E500EF84CA8 /* APContactBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APContactBuilder.h; sourceTree = ""; }; + 2DBA11170804B654CECD936A /* APAddressBookExternalChangeRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookExternalChangeRoutine.h; sourceTree = ""; }; + 2DBA11B0EC619BED683F6711 /* APAddressBookContactsRoutine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookContactsRoutine.m; sourceTree = ""; }; + 2DBA1227B13567F25214F8D0 /* APAddressBookExternalChangeRoutine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookExternalChangeRoutine.m; sourceTree = ""; }; + 2DBA1255976D8F3E678CC03E /* APAddressBookExternalChangeDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookExternalChangeDelegate.h; sourceTree = ""; }; + 2DBA1287DEC3F992050F887B /* APAddressBookBaseRoutine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookBaseRoutine.m; sourceTree = ""; }; + 2DBA12C4AEF14E4C04E0CDBB /* APAddressBook-Bridging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "APAddressBook-Bridging.h"; sourceTree = ""; }; + 2DBA136BD7C11DDC5F071275 /* APContact.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APContact.m; sourceTree = ""; }; + 2DBA137DA1598E265ED8840C /* APAddressBook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBook.m; sourceTree = ""; }; + 2DBA1418837108CF1C2D4B09 /* APAddressBookRefWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookRefWrapper.h; sourceTree = ""; }; + 2DBA152EB43C52D7C4535395 /* APPhoneWithLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APPhoneWithLabel.h; sourceTree = ""; }; + 2DBA154348EC8B2F2867E138 /* APAddressBookAccessRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookAccessRoutine.h; sourceTree = ""; }; + 2DBA15ECE97068DB78C2558B /* APAddressBookBaseRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookBaseRoutine.h; sourceTree = ""; }; + 2DBA163743140685D41F00FC /* APAddressBookContactsRoutine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBookContactsRoutine.h; sourceTree = ""; }; + 2DBA166BA5DC5DE339DD66CC /* APThread.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APThread.m; sourceTree = ""; }; + 2DBA1691A60FB12AB476E05E /* NSArray+APAddressBook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+APAddressBook.h"; sourceTree = ""; }; + 2DBA16D8163840F710E2EAA4 /* APAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddress.h; sourceTree = ""; }; + 2DBA17272868178AC43272AD /* APPhoneWithLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APPhoneWithLabel.m; sourceTree = ""; }; + 2DBA178048ED0F22E391EBDA /* APAddressBookRefWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookRefWrapper.m; sourceTree = ""; }; + 2DBA1AA1E14E68E764EC5F97 /* APContactBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APContactBuilder.m; sourceTree = ""; }; + 2DBA1AB1EBAD5D9F41F65BAB /* NSArray+APAddressBook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+APAddressBook.m"; sourceTree = ""; }; + 2DBA1B2B0C10FC48FAAC3929 /* APTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APTypes.h; sourceTree = ""; }; + 2DBA1CCDBC03A68030EE8E77 /* APSocialProfile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APSocialProfile.m; sourceTree = ""; }; + 2DBA1CE7395282C6FB6DCA8C /* APThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APThread.h; sourceTree = ""; }; + 2DBA1DCD87EF12456C78A9A5 /* APAddressBookAccessRoutine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APAddressBookAccessRoutine.m; sourceTree = ""; }; + 2DBA1E005EA6FE5BEFF19699 /* APAddressBook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APAddressBook.h; sourceTree = ""; }; + 2DBA1E07C8D589DA1C995EFD /* APContact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APContact.h; sourceTree = ""; }; + 2DBA1FB1EF866617AC97251F /* APSocialProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APSocialProfile.h; sourceTree = ""; }; + 66F112F4D42891A3F34E4113 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + C119F157280640CA31CD4E27 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + E7E250D68A454F4989DC2929 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + FA3B984A198AB8C2005953CE /* Bridging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bridging.h; sourceTree = ""; }; + FA3B984B198ABBB5005953CE /* TableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableViewCell.swift; sourceTree = ""; }; + FACA833F198AB2FD0059676C /* AddressBook.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AddressBook.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FACA8343198AB2FD0059676C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FACA8344198AB2FD0059676C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + FACA8346198AB2FD0059676C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + FACA8349198AB2FD0059676C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + FACA834B198AB2FD0059676C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FACA833C198AB2FD0059676C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AC7C9DDD497D46C0BC5090E1 /* libPods.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2DBA10C639A25917E4AAF8A0 /* Base */ = { + isa = PBXGroup; + children = ( + 2DBA15ECE97068DB78C2558B /* APAddressBookBaseRoutine.h */, + 2DBA1287DEC3F992050F887B /* APAddressBookBaseRoutine.m */, + ); + path = Base; + sourceTree = ""; + }; + 2DBA120DA9E8AA8B4C24D249 /* Core */ = { + isa = PBXGroup; + children = ( + 2DBA15A40C639D88DD4540E9 /* Public */, + 2DBA1D0C3FA8417E1914D49F /* Private */, + ); + path = Core; + sourceTree = ""; + }; + 2DBA131188FB33143F18515D /* Builders */ = { + isa = PBXGroup; + children = ( + 2DBA10FDA9851E500EF84CA8 /* APContactBuilder.h */, + 2DBA1AA1E14E68E764EC5F97 /* APContactBuilder.m */, + ); + path = Builders; + sourceTree = ""; + }; + 2DBA152B6484D4058D996CD1 /* Thread */ = { + isa = PBXGroup; + children = ( + 2DBA1CE7395282C6FB6DCA8C /* APThread.h */, + 2DBA166BA5DC5DE339DD66CC /* APThread.m */, + ); + path = Thread; + sourceTree = ""; + }; + 2DBA15370E19F27206312A64 /* Models */ = { + isa = PBXGroup; + children = ( + 2DBA1B2B0C10FC48FAAC3929 /* APTypes.h */, + 2DBA16D8163840F710E2EAA4 /* APAddress.h */, + 2DBA10262649476BA9146580 /* APAddress.m */, + 2DBA1E07C8D589DA1C995EFD /* APContact.h */, + 2DBA136BD7C11DDC5F071275 /* APContact.m */, + 2DBA1FB1EF866617AC97251F /* APSocialProfile.h */, + 2DBA1CCDBC03A68030EE8E77 /* APSocialProfile.m */, + 2DBA152EB43C52D7C4535395 /* APPhoneWithLabel.h */, + 2DBA17272868178AC43272AD /* APPhoneWithLabel.m */, + ); + path = Models; + sourceTree = ""; + }; + 2DBA15A40C639D88DD4540E9 /* Public */ = { + isa = PBXGroup; + children = ( + 2DBA15370E19F27206312A64 /* Models */, + 2DBA1E005EA6FE5BEFF19699 /* APAddressBook.h */, + 2DBA137DA1598E265ED8840C /* APAddressBook.m */, + ); + path = Public; + sourceTree = ""; + }; + 2DBA19DEF57E64275AC40BDD /* Swift */ = { + isa = PBXGroup; + children = ( + 2DBA12C4AEF14E4C04E0CDBB /* APAddressBook-Bridging.h */, + ); + path = Swift; + sourceTree = ""; + }; + 2DBA1AF9778AE75C4C0F23AE /* Pod */ = { + isa = PBXGroup; + children = ( + 2DBA120DA9E8AA8B4C24D249 /* Core */, + 2DBA19DEF57E64275AC40BDD /* Swift */, + ); + name = Pod; + path = ../../Pod; + sourceTree = ""; + }; + 2DBA1B46FE9D2978808B5748 /* Wrapper */ = { + isa = PBXGroup; + children = ( + 2DBA1418837108CF1C2D4B09 /* APAddressBookRefWrapper.h */, + 2DBA178048ED0F22E391EBDA /* APAddressBookRefWrapper.m */, + ); + path = Wrapper; + sourceTree = ""; + }; + 2DBA1B888AEC41D459877D44 /* Categories */ = { + isa = PBXGroup; + children = ( + 2DBA1691A60FB12AB476E05E /* NSArray+APAddressBook.h */, + 2DBA1AB1EBAD5D9F41F65BAB /* NSArray+APAddressBook.m */, + ); + path = Categories; + sourceTree = ""; + }; + 2DBA1D0C3FA8417E1914D49F /* Private */ = { + isa = PBXGroup; + children = ( + 2DBA152B6484D4058D996CD1 /* Thread */, + 2DBA1D8751A980E403C4E3EE /* Routine */, + 2DBA1B46FE9D2978808B5748 /* Wrapper */, + 2DBA131188FB33143F18515D /* Builders */, + 2DBA1B888AEC41D459877D44 /* Categories */, + ); + path = Private; + sourceTree = ""; + }; + 2DBA1D8751A980E403C4E3EE /* Routine */ = { + isa = PBXGroup; + children = ( + 2DBA10C639A25917E4AAF8A0 /* Base */, + 2DBA154348EC8B2F2867E138 /* APAddressBookAccessRoutine.h */, + 2DBA1DCD87EF12456C78A9A5 /* APAddressBookAccessRoutine.m */, + 2DBA163743140685D41F00FC /* APAddressBookContactsRoutine.h */, + 2DBA11B0EC619BED683F6711 /* APAddressBookContactsRoutine.m */, + 2DBA11170804B654CECD936A /* APAddressBookExternalChangeRoutine.h */, + 2DBA1227B13567F25214F8D0 /* APAddressBookExternalChangeRoutine.m */, + 2DBA1255976D8F3E678CC03E /* APAddressBookExternalChangeDelegate.h */, + ); + path = Routine; + sourceTree = ""; + }; + 4845391491E59C918D93E784 /* Pods */ = { + isa = PBXGroup; + children = ( + C119F157280640CA31CD4E27 /* Pods.debug.xcconfig */, + 66F112F4D42891A3F34E4113 /* Pods.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 65E3953D9FB24ACD81049105 /* Frameworks */ = { + isa = PBXGroup; + children = ( + E7E250D68A454F4989DC2929 /* libPods.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + FA3B9847198AB4CC005953CE /* AppDelegate */ = { + isa = PBXGroup; + children = ( + FACA8344198AB2FD0059676C /* AppDelegate.swift */, + ); + name = AppDelegate; + sourceTree = ""; + }; + FA3B9848198AB4D4005953CE /* Controllers */ = { + isa = PBXGroup; + children = ( + FACA8346198AB2FD0059676C /* ViewController.swift */, + FACA8348198AB2FD0059676C /* Main.storyboard */, + ); + name = Controllers; + sourceTree = ""; + }; + FA3B984D198ABBBA005953CE /* Views */ = { + isa = PBXGroup; + children = ( + FA3B984B198ABBB5005953CE /* TableViewCell.swift */, + ); + name = Views; + sourceTree = ""; + }; + FACA8336198AB2FD0059676C = { + isa = PBXGroup; + children = ( + FACA8341198AB2FD0059676C /* AddressBook */, + FACA8340198AB2FD0059676C /* Products */, + 65E3953D9FB24ACD81049105 /* Frameworks */, + 4845391491E59C918D93E784 /* Pods */, + 2DBA1AF9778AE75C4C0F23AE /* Pod */, + ); + sourceTree = ""; + }; + FACA8340198AB2FD0059676C /* Products */ = { + isa = PBXGroup; + children = ( + FACA833F198AB2FD0059676C /* AddressBook.app */, + ); + name = Products; + sourceTree = ""; + }; + FACA8341198AB2FD0059676C /* AddressBook */ = { + isa = PBXGroup; + children = ( + FA3B9848198AB4D4005953CE /* Controllers */, + FA3B984D198ABBBA005953CE /* Views */, + FA3B9847198AB4CC005953CE /* AppDelegate */, + FACA834B198AB2FD0059676C /* Images.xcassets */, + FACA8342198AB2FD0059676C /* Supporting Files */, + ); + path = AddressBook; + sourceTree = ""; + }; + FACA8342198AB2FD0059676C /* Supporting Files */ = { + isa = PBXGroup; + children = ( + FA3B984A198AB8C2005953CE /* Bridging.h */, + FACA8343198AB2FD0059676C /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FACA833E198AB2FD0059676C /* AddressBook */ = { + isa = PBXNativeTarget; + buildConfigurationList = FACA835B198AB2FD0059676C /* Build configuration list for PBXNativeTarget "AddressBook" */; + buildPhases = ( + 33F0520C9FDA49DCA3BB9D9C /* Check Pods Manifest.lock */, + FACA833B198AB2FD0059676C /* Sources */, + FACA833C198AB2FD0059676C /* Frameworks */, + FACA833D198AB2FD0059676C /* Resources */, + B2898E40613B4BB0A854A658 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = AddressBook; + productName = AddressBook; + productReference = FACA833F198AB2FD0059676C /* AddressBook.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FACA8337198AB2FD0059676C /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 0600; + ORGANIZATIONNAME = alterplay; + TargetAttributes = { + FACA833E198AB2FD0059676C = { + CreatedOnToolsVersion = 6.0; + }; + }; + }; + buildConfigurationList = FACA833A198AB2FD0059676C /* Build configuration list for PBXProject "AddressBook" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FACA8336198AB2FD0059676C; + productRefGroup = FACA8340198AB2FD0059676C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FACA833E198AB2FD0059676C /* AddressBook */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FACA833D198AB2FD0059676C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FACA834A198AB2FD0059676C /* Main.storyboard in Resources */, + FACA834C198AB2FD0059676C /* Images.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 33F0520C9FDA49DCA3BB9D9C /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + B2898E40613B4BB0A854A658 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FACA833B198AB2FD0059676C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FACA8347198AB2FD0059676C /* ViewController.swift in Sources */, + FA3B984C198ABBB5005953CE /* TableViewCell.swift in Sources */, + FACA8345198AB2FD0059676C /* AppDelegate.swift in Sources */, + 2DBA12DBFBB704807665A12B /* APAddress.m in Sources */, + 2DBA1F350A6F2D748B83886D /* APContact.m in Sources */, + 2DBA109CD7D77BFADB550567 /* APSocialProfile.m in Sources */, + 2DBA158CA5FC69C94F759FC4 /* APPhoneWithLabel.m in Sources */, + 2DBA1CC57636698E29AA4DD2 /* APAddressBook.m in Sources */, + 2DBA1CCACA567202FE258B22 /* APThread.m in Sources */, + 2DBA1F9D6F4E3ABEA593AC81 /* APAddressBookBaseRoutine.m in Sources */, + 2DBA1583992FF8028413D0E9 /* APAddressBookAccessRoutine.m in Sources */, + 2DBA1B304136013C113208AF /* APAddressBookContactsRoutine.m in Sources */, + 2DBA1EB91583F7F331983105 /* APAddressBookExternalChangeRoutine.m in Sources */, + 2DBA1567014634F6777E18EC /* APAddressBookRefWrapper.m in Sources */, + 2DBA10EBE7BD7100D56F72FF /* APContactBuilder.m in Sources */, + 2DBA1A725FC4FA075E5F160D /* NSArray+APAddressBook.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + FACA8348198AB2FD0059676C /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FACA8349198AB2FD0059676C /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FACA8359198AB2FD0059676C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + FACA835A198AB2FD0059676C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + FACA835C198AB2FD0059676C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C119F157280640CA31CD4E27 /* Pods.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + INFOPLIST_FILE = AddressBook/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = AddressBook/Bridging.h; + }; + name = Debug; + }; + FACA835D198AB2FD0059676C /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 66F112F4D42891A3F34E4113 /* Pods.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + INFOPLIST_FILE = AddressBook/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = AddressBook/Bridging.h; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FACA833A198AB2FD0059676C /* Build configuration list for PBXProject "AddressBook" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FACA8359198AB2FD0059676C /* Debug */, + FACA835A198AB2FD0059676C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FACA835B198AB2FD0059676C /* Build configuration list for PBXNativeTarget "AddressBook" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FACA835C198AB2FD0059676C /* Debug */, + FACA835D198AB2FD0059676C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FACA8337198AB2FD0059676C /* Project object */; +} diff --git a/Example/Swift/AddressBook/Base.lproj/Main.storyboard b/Example/Swift/AddressBook/Base.lproj/Main.storyboard index 712082d..96d4746 100644 --- a/Example/Swift/AddressBook/Base.lproj/Main.storyboard +++ b/Example/Swift/AddressBook/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + diff --git a/Example/Swift/AddressBook/ViewController.swift b/Example/Swift/AddressBook/ViewController.swift index 20fe3ca..188d66a 100644 --- a/Example/Swift/AddressBook/ViewController.swift +++ b/Example/Swift/AddressBook/ViewController.swift @@ -36,6 +36,4 @@ class ViewController: DTTableViewController { } }) } - -} - +} \ No newline at end of file diff --git a/Example/Swift/Podfile.lock b/Example/Swift/Podfile.lock index 0ebb678..2ff27e5 100644 --- a/Example/Swift/Podfile.lock +++ b/Example/Swift/Podfile.lock @@ -21,4 +21,4 @@ SPEC CHECKSUMS: DTModelStorage: 2842a94c4f4b2202f953cfcfff1bb9cc61e1ffbe DTTableViewManager: 490b4b131e8819b090fbc515292d60174ac92154 -COCOAPODS: 0.37.2 +COCOAPODS: 0.38.2 diff --git a/Pod/Core/Private/Builders/APContactBuilder.h b/Pod/Core/Private/Builders/APContactBuilder.h index b7c3eba..b7df126 100644 --- a/Pod/Core/Private/Builders/APContactBuilder.h +++ b/Pod/Core/Private/Builders/APContactBuilder.h @@ -14,6 +14,6 @@ @interface APContactBuilder : NSObject -+ (APContact *)contactWithRecordRef:(ABRecordRef)recordRef fieldMask:(APContactField)fieldMask; +- (APContact *)contactWithRecordRef:(ABRecordRef)recordRef fieldMask:(APContactField)fieldMask; @end \ No newline at end of file diff --git a/Pod/Core/Private/Builders/APContactBuilder.m b/Pod/Core/Private/Builders/APContactBuilder.m index 20c1ef7..5a9b5a5 100644 --- a/Pod/Core/Private/Builders/APContactBuilder.m +++ b/Pod/Core/Private/Builders/APContactBuilder.m @@ -6,95 +6,78 @@ // Copyright © 2015 alterplay. All rights reserved. // -#import #import "APContactBuilder.h" +#import "APContactDataExtractor.h" #import "APContact.h" -#import "APAddress.h" -#import "APPhoneWithLabel.h" -#import "APSocialProfile.h" -@interface APContact () -@property (nonatomic, strong) NSString *firstName; -@property (nonatomic, strong) NSString *middleName; -@property (nonatomic, strong) NSString *lastName; -@property (nonatomic, strong) NSString *compositeName; -@property (nonatomic, strong) NSString *company; -@property (nonatomic, strong) NSString *jobTitle; -@property (nonatomic, strong) NSArray *phones; -@property (nonatomic, strong) NSArray *phonesWithLabels; -@property (nonatomic, strong) NSArray *emails; -@property (nonatomic, strong) NSArray *addresses; -@property (nonatomic, strong) UIImage *photo; -@property (nonatomic, strong) UIImage *thumbnail; -@property (nonatomic, strong) NSNumber *recordID; -@property (nonatomic, strong) NSDate *creationDate; -@property (nonatomic, strong) NSDate *modificationDate; -@property (nonatomic, strong) NSArray *socialProfiles; -@property (nonatomic, strong) NSString *note; -@property (nonatomic, strong) NSArray *linkedRecordIDs; +@interface APContactBuilder () +@property (nonatomic, strong) APContactDataExtractor *extractor; @end @implementation APContactBuilder +#pragma mark - life cycle + +- (instancetype)init +{ + self = [super init]; + self.extractor = [[APContactDataExtractor alloc] init]; + return self; +} + #pragma mark - public -+ (APContact *)contactWithRecordRef:(ABRecordRef)recordRef fieldMask:(APContactField)fieldMask +- (APContact *)contactWithRecordRef:(ABRecordRef)recordRef fieldMask:(APContactField)fieldMask { + self.extractor.recordRef = recordRef; APContact *contact = [[APContact alloc] init]; if (fieldMask & APContactFieldFirstName) { - contact.firstName = [self stringProperty:kABPersonFirstNameProperty fromRecord:recordRef]; + contact.firstName = [self.extractor stringProperty:kABPersonFirstNameProperty]; } if (fieldMask & APContactFieldMiddleName) { - contact.middleName = [self stringProperty:kABPersonMiddleNameProperty fromRecord:recordRef]; + contact.middleName = [self.extractor stringProperty:kABPersonMiddleNameProperty]; } if (fieldMask & APContactFieldLastName) { - contact.lastName = [self stringProperty:kABPersonLastNameProperty fromRecord:recordRef]; + contact.lastName = [self.extractor stringProperty:kABPersonLastNameProperty]; } if (fieldMask & APContactFieldCompositeName) { - contact.compositeName = [self compositeNameFromRecord:recordRef]; + contact.compositeName = [self.extractor compositeName]; } if (fieldMask & APContactFieldCompany) { - contact.company = [self stringProperty:kABPersonOrganizationProperty fromRecord:recordRef]; + contact.company = [self.extractor stringProperty:kABPersonOrganizationProperty]; } if (fieldMask & APContactFieldJobTitle) { - contact.jobTitle = [self stringProperty:kABPersonJobTitleProperty fromRecord:recordRef]; + contact.jobTitle = [self.extractor stringProperty:kABPersonJobTitleProperty]; } if (fieldMask & APContactFieldPhones) { - contact.phones = [self arrayProperty:kABPersonPhoneProperty fromRecord:recordRef]; + contact.phones = [self.extractor arrayProperty:kABPersonPhoneProperty]; } if (fieldMask & APContactFieldPhonesWithLabels) { - contact.phonesWithLabels = [self arrayOfPhonesWithLabelsFromRecord:recordRef]; + contact.phonesWithLabels = [self.extractor phonesWithLabels]; } if (fieldMask & APContactFieldEmails) { - contact.emails = [self arrayProperty:kABPersonEmailProperty fromRecord:recordRef]; + contact.emails = [self.extractor arrayProperty:kABPersonEmailProperty]; } if (fieldMask & APContactFieldPhoto) { - contact.photo = [self imagePropertyFullSize:YES fromRecord:recordRef]; + contact.photo = [self.extractor imagePropertyFullSize:YES]; } if (fieldMask & APContactFieldThumbnail) { - contact.thumbnail = [self imagePropertyFullSize:NO fromRecord:recordRef]; + contact.thumbnail = [self.extractor imagePropertyFullSize:NO]; } if (fieldMask & APContactFieldAddresses) { - NSMutableArray *addresses = [[NSMutableArray alloc] init]; - NSArray *array = [self arrayProperty:kABPersonAddressProperty fromRecord:recordRef]; - for (NSDictionary *dictionary in array) - { - APAddress *address = [[APAddress alloc] initWithAddressDictionary:dictionary]; - [addresses addObject:address]; - } - contact.addresses = addresses.copy; + contact.addresses = [self.extractor addresses]; } if (fieldMask & APContactFieldRecordID) { @@ -102,150 +85,25 @@ + (APContact *)contactWithRecordRef:(ABRecordRef)recordRef fieldMask:(APContactF } if (fieldMask & APContactFieldCreationDate) { - contact.creationDate = [self dateProperty:kABPersonCreationDateProperty fromRecord:recordRef]; + contact.creationDate = [self.extractor dateProperty:kABPersonCreationDateProperty]; } if (fieldMask & APContactFieldModificationDate) { - contact.modificationDate = [self dateProperty:kABPersonModificationDateProperty fromRecord:recordRef]; + contact.modificationDate = [self.extractor dateProperty:kABPersonModificationDateProperty]; } if (fieldMask & APContactFieldSocialProfiles) { - NSMutableArray *profiles = [[NSMutableArray alloc] init]; - NSArray *array = [self arrayProperty:kABPersonSocialProfileProperty fromRecord:recordRef]; - for (NSDictionary *dictionary in array) - { - APSocialProfile *profile = [[APSocialProfile alloc] initWithSocialDictionary:dictionary]; - [profiles addObject:profile]; - } - - contact.socialProfiles = profiles; + contact.socialProfiles = [self.extractor socialProfiles]; } if (fieldMask & APContactFieldNote) { - contact.note = [self stringProperty:kABPersonNoteProperty fromRecord:recordRef]; + contact.note = [self.extractor stringProperty:kABPersonNoteProperty]; } if (fieldMask & APContactFieldLinkedRecordIDs) { - NSMutableOrderedSet *linkedRecordIDs = [[NSMutableOrderedSet alloc] init]; - - CFArrayRef linkedPeopleRef = ABPersonCopyArrayOfAllLinkedPeople(recordRef); - CFIndex count = CFArrayGetCount(linkedPeopleRef); - for (CFIndex i = 0; i < count; i++) - { - ABRecordRef linkedRecordRef = CFArrayGetValueAtIndex(linkedPeopleRef, i); - [linkedRecordIDs addObject:@(ABRecordGetRecordID(linkedRecordRef))]; - } - CFRelease(linkedPeopleRef); - - // remove self from linked records - [linkedRecordIDs removeObject:@(ABRecordGetRecordID(recordRef))]; - contact.linkedRecordIDs = linkedRecordIDs.array; + contact.linkedRecordIDs = [self.extractor linkedRecordIDs]; } return contact; } -#pragma mark - private - -+ (NSString *)stringProperty:(ABPropertyID)property fromRecord:(ABRecordRef)recordRef -{ - CFTypeRef valueRef = (ABRecordCopyValue(recordRef, property)); - return (__bridge_transfer NSString *)valueRef; -} - -+ (NSArray *)arrayProperty:(ABPropertyID)property fromRecord:(ABRecordRef)recordRef -{ - NSMutableArray *array = [[NSMutableArray alloc] init]; - [self enumerateMultiValueOfProperty:property fromRecord:recordRef - withBlock:^(ABMultiValueRef multiValue, NSUInteger index) - { - CFTypeRef value = ABMultiValueCopyValueAtIndex(multiValue, index); - NSString *string = (__bridge_transfer NSString *)value; - if (string) - { - [array addObject:string]; - } - }]; - return array.copy; -} - - -+ (NSDate *)dateProperty:(ABPropertyID)property fromRecord:(ABRecordRef)recordRef -{ - CFDateRef dateRef = (ABRecordCopyValue(recordRef, property)); - return (__bridge_transfer NSDate *)dateRef; -} - -+ (NSArray *)arrayOfPhonesWithLabelsFromRecord:(ABRecordRef)recordRef -{ - NSMutableArray *array = [[NSMutableArray alloc] init]; - [self enumerateMultiValueOfProperty:kABPersonPhoneProperty fromRecord:recordRef - withBlock:^(ABMultiValueRef multiValue, NSUInteger index) - { - CFTypeRef rawPhone = ABMultiValueCopyValueAtIndex(multiValue, index); - NSString *phone = (__bridge_transfer NSString *)rawPhone; - if (phone) - { - NSString *originalLabel = [self originalLabelFromMultiValue:multiValue index:index]; - NSString *localizedLabel = [self localizedLabelFromMultiValue:multiValue index:index]; - APPhoneWithLabel *phoneWithLabel = [[APPhoneWithLabel alloc] initWithPhone:phone originalLabel:originalLabel - localizedLabel:localizedLabel]; - [array addObject:phoneWithLabel]; - } - }]; - return array.copy; -} - -+ (UIImage *)imagePropertyFullSize:(BOOL)isFullSize fromRecord:(ABRecordRef)recordRef -{ - ABPersonImageFormat format = isFullSize ? kABPersonImageFormatOriginalSize : - kABPersonImageFormatThumbnail; - NSData *data = (__bridge_transfer NSData *)ABPersonCopyImageDataWithFormat(recordRef, format); - return [UIImage imageWithData:data scale:UIScreen.mainScreen.scale]; -} - -+ (NSString *)originalLabelFromMultiValue:(ABMultiValueRef)multiValue index:(NSUInteger)index -{ - NSString *label; - CFTypeRef rawLabel = ABMultiValueCopyLabelAtIndex(multiValue, index); - label = (__bridge_transfer NSString *)rawLabel; - return label; -} - -+ (NSString *)localizedLabelFromMultiValue:(ABMultiValueRef)multiValue index:(NSUInteger)index -{ - NSString *label; - CFTypeRef rawLabel = ABMultiValueCopyLabelAtIndex(multiValue, index); - if (rawLabel) - { - CFStringRef localizedLabel = ABAddressBookCopyLocalizedLabel(rawLabel); - if (localizedLabel) - { - label = (__bridge_transfer NSString *)localizedLabel; - } - CFRelease(rawLabel); - } - return label; -} - -+ (NSString *)compositeNameFromRecord:(ABRecordRef)recordRef -{ - CFStringRef compositeNameRef = ABRecordCopyCompositeName(recordRef); - return (__bridge_transfer NSString *)compositeNameRef; -} - -+ (void)enumerateMultiValueOfProperty:(ABPropertyID)property fromRecord:(ABRecordRef)recordRef - withBlock:(void (^)(ABMultiValueRef multiValue, NSUInteger index))block -{ - ABMultiValueRef multiValue = ABRecordCopyValue(recordRef, property); - if (multiValue) - { - NSUInteger count = (NSUInteger)ABMultiValueGetCount(multiValue); - for (NSUInteger i = 0; i < count; i++) - { - block(multiValue, i); - } - CFRelease(multiValue); - } -} - @end \ No newline at end of file diff --git a/Pod/Core/Private/Extractor/APContactDataExtractor.h b/Pod/Core/Private/Extractor/APContactDataExtractor.h new file mode 100644 index 0000000..01637a0 --- /dev/null +++ b/Pod/Core/Private/Extractor/APContactDataExtractor.h @@ -0,0 +1,27 @@ +// +// APContactDataExtractor +// AddressBook +// +// Created by Alexey Belkevich on 22.09.15. +// Copyright © 2015 alterplay. All rights reserved. +// + +#import +#import +#import + +@interface APContactDataExtractor : NSObject + +@property (nonatomic, assign) ABRecordRef recordRef; + +- (NSString *)stringProperty:(ABPropertyID)property; +- (NSArray *)arrayProperty:(ABPropertyID)property; +- (NSDate *)dateProperty:(ABPropertyID)property; +- (UIImage *)imagePropertyFullSize:(BOOL)isFullSize; +- (NSArray *)phonesWithLabels; +- (NSArray *)addresses; +- (NSString *)compositeName; +- (NSArray *)socialProfiles; +- (NSArray *)linkedRecordIDs; + +@end \ No newline at end of file diff --git a/Pod/Core/Private/Extractor/APContactDataExtractor.m b/Pod/Core/Private/Extractor/APContactDataExtractor.m new file mode 100644 index 0000000..073ad9d --- /dev/null +++ b/Pod/Core/Private/Extractor/APContactDataExtractor.m @@ -0,0 +1,175 @@ +// +// APContactDataExtractor +// AddressBook +// +// Created by Alexey Belkevich on 22.09.15. +// Copyright © 2015 alterplay. All rights reserved. +// + +#import "APContactDataExtractor.h" +#import "APPhoneWithLabel.h" +#import "APAddress.h" +#import "APSocialProfile.h" +#import "APSocialServiceHelper.h" + +@implementation APContactDataExtractor + +#pragma mark - public + +- (NSString *)stringProperty:(ABPropertyID)property +{ + CFTypeRef valueRef = (ABRecordCopyValue(self.recordRef, property)); + return (__bridge_transfer NSString *)valueRef; +} + +- (NSArray *)arrayProperty:(ABPropertyID)property +{ + NSMutableArray *array = [[NSMutableArray alloc] init]; + [self enumerateMultiValueOfProperty:property withBlock:^(ABMultiValueRef multiValue, CFIndex index) + { + CFTypeRef value = ABMultiValueCopyValueAtIndex(multiValue, index); + NSString *string = (__bridge_transfer NSString *)value; + if (string) + { + [array addObject:string]; + } + }]; + return array.copy; +} + +- (NSDate *)dateProperty:(ABPropertyID)property +{ + CFDateRef dateRef = ABRecordCopyValue(self.recordRef, property); + return (__bridge_transfer NSDate *)dateRef; +} + +- (UIImage *)imagePropertyFullSize:(BOOL)isFullSize +{ + ABPersonImageFormat format = isFullSize ? kABPersonImageFormatOriginalSize : + kABPersonImageFormatThumbnail; + NSData *data = (__bridge_transfer NSData *)ABPersonCopyImageDataWithFormat(self.recordRef, format); + return [UIImage imageWithData:data scale:UIScreen.mainScreen.scale]; +} + +- (NSArray *)phonesWithLabels +{ + NSMutableArray *array = [[NSMutableArray alloc] init]; + [self enumerateMultiValueOfProperty:kABPersonPhoneProperty withBlock:^(ABMultiValueRef multiValue, CFIndex index) + { + CFTypeRef rawPhone = ABMultiValueCopyValueAtIndex(multiValue, index); + NSString *phone = (__bridge_transfer NSString *)rawPhone; + if (phone) + { + NSString *originalLabel = [self originalLabelFromMultiValue:multiValue index:index]; + NSString *localizedLabel = [self localizedLabelFromMultiValue:multiValue index:index]; + APPhoneWithLabel *phoneWithLabel = [[APPhoneWithLabel alloc] init]; + phoneWithLabel.phone = phone; + phoneWithLabel.originalLabel = originalLabel; + phoneWithLabel.localizedLabel = localizedLabel; + [array addObject:phoneWithLabel]; + } + }]; + return array.copy; +} + +- (NSArray *)addresses +{ + NSMutableArray *addresses = [[NSMutableArray alloc] init]; + NSArray *array = [self arrayProperty:kABPersonAddressProperty]; + for (NSDictionary *dictionary in array) + { + APAddress *address = [[APAddress alloc] init]; + address.street = dictionary[(__bridge NSString *)kABPersonAddressStreetKey]; + address.city = dictionary[(__bridge NSString *)kABPersonAddressCityKey]; + address.state = dictionary[(__bridge NSString *)kABPersonAddressStateKey]; + address.zip = dictionary[(__bridge NSString *)kABPersonAddressZIPKey]; + address.country = dictionary[(__bridge NSString *)kABPersonAddressCountryKey]; + address.countryCode = dictionary[(__bridge NSString *)kABPersonAddressCountryCodeKey]; + [addresses addObject:address]; + } + return addresses.copy; +} + +- (NSString *)compositeName +{ + CFStringRef compositeNameRef = ABRecordCopyCompositeName(self.recordRef); + return (__bridge_transfer NSString *)compositeNameRef; +} + +- (NSArray *)socialProfiles +{ + NSMutableArray *profiles = [[NSMutableArray alloc] init]; + NSArray *array = [self arrayProperty:kABPersonSocialProfileProperty]; + for (NSDictionary *dictionary in array) + { + APSocialProfile *profile = [[APSocialProfile alloc] init]; + NSString *socialService = dictionary[(__bridge NSString *)kABPersonSocialProfileServiceKey]; + profile.socialNetwork = [APSocialServiceHelper socialNetworkTypeWithString:socialService]; + profile.url = dictionary[(__bridge NSString *)kABPersonSocialProfileURLKey]; + profile.username = dictionary[(__bridge NSString *)kABPersonSocialProfileUsernameKey]; + profile.userIdentifier = dictionary[(__bridge NSString *)kABPersonSocialProfileUserIdentifierKey]; + [profiles addObject:profile]; + } + return profiles.copy; +} + +- (NSArray *)linkedRecordIDs +{ + NSMutableOrderedSet *linkedRecordIDs = [[NSMutableOrderedSet alloc] init]; + CFArrayRef linkedPeopleRef = ABPersonCopyArrayOfAllLinkedPeople(self.recordRef); + CFIndex count = CFArrayGetCount(linkedPeopleRef); + NSNumber *contactRecordID = @(ABRecordGetRecordID(self.recordRef)); + for (CFIndex i = 0; i < count; i++) + { + ABRecordRef linkedRecordRef = CFArrayGetValueAtIndex(linkedPeopleRef, i); + NSNumber *linkedRecordID = @(ABRecordGetRecordID(linkedRecordRef)); + if (![linkedRecordID isEqualToNumber:contactRecordID]) + { + [linkedRecordIDs addObject:linkedRecordID]; + } + } + CFRelease(linkedPeopleRef); + return linkedRecordIDs.array; +} + +#pragma mark - private + +- (NSString *)originalLabelFromMultiValue:(ABMultiValueRef)multiValue index:(CFIndex)index +{ + CFTypeRef rawLabel = ABMultiValueCopyLabelAtIndex(multiValue, index); + NSString *label = (__bridge_transfer NSString *)rawLabel; + return label; +} + +- (NSString *)localizedLabelFromMultiValue:(ABMultiValueRef)multiValue index:(CFIndex)index +{ + NSString *label; + CFTypeRef rawLabel = ABMultiValueCopyLabelAtIndex(multiValue, index); + if (rawLabel) + { + CFStringRef localizedLabel = ABAddressBookCopyLocalizedLabel(rawLabel); + if (localizedLabel) + { + label = (__bridge_transfer NSString *)localizedLabel; + } + CFRelease(rawLabel); + } + return label; +} + +- (void)enumerateMultiValueOfProperty:(ABPropertyID)property + withBlock:(void (^)(ABMultiValueRef multiValue, CFIndex index))block +{ + ABMultiValueRef multiValue = ABRecordCopyValue(self.recordRef, property); + if (multiValue) + { + CFIndex count = ABMultiValueGetCount(multiValue); + for (CFIndex i = 0; i < count; i++) + { + block(multiValue, i); + } + CFRelease(multiValue); + } +} + +@end \ No newline at end of file diff --git a/Pod/Core/Private/Helpers/APSocialServiceHelper.h b/Pod/Core/Private/Helpers/APSocialServiceHelper.h new file mode 100644 index 0000000..7ec8042 --- /dev/null +++ b/Pod/Core/Private/Helpers/APSocialServiceHelper.h @@ -0,0 +1,16 @@ +// +// APSocialServiceHelper +// AddressBook +// +// Created by Alexey Belkevich on 22.09.15. +// Copyright © 2015 alterplay. All rights reserved. +// + +#import +#import "APTypes.h" + +@interface APSocialServiceHelper : NSObject + ++ (APSocialNetworkType)socialNetworkTypeWithString:(NSString *)string; + +@end \ No newline at end of file diff --git a/Pod/Core/Private/Helpers/APSocialServiceHelper.m b/Pod/Core/Private/Helpers/APSocialServiceHelper.m new file mode 100644 index 0000000..c7cbc47 --- /dev/null +++ b/Pod/Core/Private/Helpers/APSocialServiceHelper.m @@ -0,0 +1,42 @@ +// +// APSocialServiceHelper +// AddressBook +// +// Created by Alexey Belkevich on 22.09.15. +// Copyright © 2015 alterplay. All rights reserved. +// + +#import +#import "APSocialServiceHelper.h" + +@implementation APSocialServiceHelper + ++ (APSocialNetworkType)socialNetworkTypeWithString:(NSString *)string +{ + if ([string isEqualToString:(__bridge NSString *)kABPersonSocialProfileServiceFacebook]) + { + return APSocialNetworkFacebook; + } + else if ([string isEqualToString:(__bridge NSString *)kABPersonSocialProfileServiceTwitter]) + { + return APSocialNetworkTwitter; + } + else if ([string isEqualToString:(__bridge NSString *)kABPersonSocialProfileServiceLinkedIn]) + { + return APSocialNetworkLinkedIn; + } + else if ([string isEqualToString:(__bridge NSString *)kABPersonSocialProfileServiceFlickr]) + { + return APSocialNetworkFlickr; + } + else if ([string isEqualToString:(__bridge NSString *)kABPersonSocialProfileServiceGameCenter]) + { + return APSocialNetworkGameCenter; + } + else + { + return APSocialNetworkUnknown; + } +} + +@end \ No newline at end of file diff --git a/Pod/Core/Private/Routine/APAddressBookContactsRoutine.m b/Pod/Core/Private/Routine/APAddressBookContactsRoutine.m index 56de280..1ae2f21 100644 --- a/Pod/Core/Private/Routine/APAddressBookContactsRoutine.m +++ b/Pod/Core/Private/Routine/APAddressBookContactsRoutine.m @@ -8,11 +8,24 @@ #import #import "APAddressBookContactsRoutine.h" -#import "APContactBuilder.h" #import "APAddressBookRefWrapper.h" +#import "APContactBuilder.h" + +@interface APAddressBookContactsRoutine () +@property (nonatomic, strong) APContactBuilder *builder; +@end @implementation APAddressBookContactsRoutine +#pragma mark - life cycle + +- (instancetype)initWithAddressBookRefWrapper:(APAddressBookRefWrapper *)wrapper +{ + self = [super initWithAddressBookRefWrapper:wrapper]; + self.builder = [[APContactBuilder alloc] init]; + return self; +} + #pragma mark - public - (NSArray *)allContactsWithContactFieldMask:(APContactField)fieldMask @@ -25,7 +38,7 @@ - (NSArray *)allContactsWithContactFieldMask:(APContactField)fieldMask for (CFIndex i = 0; i < count; i++) { ABRecordRef recordRef = CFArrayGetValueAtIndex(peopleArrayRef, i); - APContact *contact = [APContactBuilder contactWithRecordRef:recordRef fieldMask:fieldMask]; + APContact *contact = [self.builder contactWithRecordRef:recordRef fieldMask:fieldMask]; [contacts addObject:contact]; } CFRelease(peopleArrayRef); @@ -38,7 +51,7 @@ - (APContact *)contactByRecordID:(NSNumber *)recordID withFieldMask:(APContactFi if (!self.wrapper.error) { ABRecordRef recordRef = ABAddressBookGetPersonWithRecordID(self.wrapper.ref, recordID.intValue); - return recordRef != NULL ? [APContactBuilder contactWithRecordRef:recordRef fieldMask:fieldMask] : nil; + return recordRef != NULL ? [self.builder contactWithRecordRef:recordRef fieldMask:fieldMask] : nil; } return nil; } diff --git a/Pod/Core/Private/Wrapper/APAddressBookRefWrapper.m b/Pod/Core/Private/Wrapper/APAddressBookRefWrapper.m index a8ad044..634666c 100644 --- a/Pod/Core/Private/Wrapper/APAddressBookRefWrapper.m +++ b/Pod/Core/Private/Wrapper/APAddressBookRefWrapper.m @@ -9,7 +9,9 @@ #import "APAddressBookRefWrapper.h" @interface APAddressBookRefWrapper () -@property (nonatomic, assign) ABAddressBookRef ref; +{ + ABAddressBookRef ref; +} @property (nonatomic, strong) NSError *error; @end @@ -21,7 +23,7 @@ - (id)init { self = [super init]; CFErrorRef *error = NULL; - self.ref = ABAddressBookCreateWithOptions(NULL, error); + ref = ABAddressBookCreateWithOptions(NULL, error); if (error) { self.error = (__bridge NSError *)(*error); @@ -31,10 +33,17 @@ - (id)init - (void)dealloc { - if (self.ref) + if (ref) { - CFRelease(self.ref); + CFRelease(ref); } } +#pragma mark - properties + +- (ABAddressBookRef)ref +{ + return ref; +} + @end \ No newline at end of file diff --git a/Pod/Core/Public/Models/APAddress.h b/Pod/Core/Public/Models/APAddress.h index 4a09a00..c1ca149 100755 --- a/Pod/Core/Public/Models/APAddress.h +++ b/Pod/Core/Public/Models/APAddress.h @@ -10,13 +10,11 @@ @interface APAddress : NSObject -@property (nonatomic, readonly) NSString *street; -@property (nonatomic, readonly) NSString *city; -@property (nonatomic, readonly) NSString *state; -@property (nonatomic, readonly) NSString *zip; -@property (nonatomic, readonly) NSString *country; -@property (nonatomic, readonly) NSString *countryCode; - -- (id)initWithAddressDictionary:(NSDictionary *)dictionary; +@property (nonatomic, strong) NSString *street; +@property (nonatomic, strong) NSString *city; +@property (nonatomic, strong) NSString *state; +@property (nonatomic, strong) NSString *zip; +@property (nonatomic, strong) NSString *country; +@property (nonatomic, strong) NSString *countryCode; @end diff --git a/Pod/Core/Public/Models/APAddress.m b/Pod/Core/Public/Models/APAddress.m index 0eb74df..2fb741b 100755 --- a/Pod/Core/Public/Models/APAddress.m +++ b/Pod/Core/Public/Models/APAddress.m @@ -6,24 +6,8 @@ // Copyright (c) 2014 alterplay. All rights reserved. // -#import #import "APAddress.h" @implementation APAddress -- (id)initWithAddressDictionary:(NSDictionary *)dictionary -{ - self = [super init]; - if (self) - { - _street = dictionary[(__bridge NSString *)kABPersonAddressStreetKey]; - _city = dictionary[(__bridge NSString *)kABPersonAddressCityKey]; - _state = dictionary[(__bridge NSString *)kABPersonAddressStateKey]; - _zip = dictionary[(__bridge NSString *)kABPersonAddressZIPKey]; - _country = dictionary[(__bridge NSString *)kABPersonAddressCountryKey]; - _countryCode = dictionary[(__bridge NSString *)kABPersonAddressCountryCodeKey]; - } - return self; -} - @end diff --git a/Pod/Core/Public/Models/APContact.h b/Pod/Core/Public/Models/APContact.h index 490e370..7e736bd 100755 --- a/Pod/Core/Public/Models/APContact.h +++ b/Pod/Core/Public/Models/APContact.h @@ -11,23 +11,23 @@ @interface APContact : NSObject -@property (nonatomic, readonly) NSString *firstName; -@property (nonatomic, readonly) NSString *middleName; -@property (nonatomic, readonly) NSString *lastName; -@property (nonatomic, readonly) NSString *compositeName; -@property (nonatomic, readonly) NSString *company; -@property (nonatomic, readonly) NSString *jobTitle; -@property (nonatomic, readonly) NSArray *phones; -@property (nonatomic, readonly) NSArray *phonesWithLabels; -@property (nonatomic, readonly) NSArray *emails; -@property (nonatomic, readonly) NSArray *addresses; -@property (nonatomic, readonly) UIImage *photo; -@property (nonatomic, readonly) UIImage *thumbnail; -@property (nonatomic, readonly) NSNumber *recordID; -@property (nonatomic, readonly) NSDate *creationDate; -@property (nonatomic, readonly) NSDate *modificationDate; -@property (nonatomic, readonly) NSArray *socialProfiles; -@property (nonatomic, readonly) NSString *note; -@property (nonatomic, readonly) NSArray *linkedRecordIDs; +@property (nonatomic, strong) NSString *firstName; +@property (nonatomic, strong) NSString *middleName; +@property (nonatomic, strong) NSString *lastName; +@property (nonatomic, strong) NSString *compositeName; +@property (nonatomic, strong) NSString *company; +@property (nonatomic, strong) NSString *jobTitle; +@property (nonatomic, strong) NSArray *phones; +@property (nonatomic, strong) NSArray *phonesWithLabels; +@property (nonatomic, strong) NSArray *emails; +@property (nonatomic, strong) NSArray *addresses; +@property (nonatomic, strong) UIImage *photo; +@property (nonatomic, strong) UIImage *thumbnail; +@property (nonatomic, strong) NSNumber *recordID; +@property (nonatomic, strong) NSDate *creationDate; +@property (nonatomic, strong) NSDate *modificationDate; +@property (nonatomic, strong) NSArray *socialProfiles; +@property (nonatomic, strong) NSString *note; +@property (nonatomic, strong) NSArray *linkedRecordIDs; @end diff --git a/Pod/Core/Public/Models/APContact.m b/Pod/Core/Public/Models/APContact.m index 21cc724..6f6132a 100755 --- a/Pod/Core/Public/Models/APContact.m +++ b/Pod/Core/Public/Models/APContact.m @@ -8,26 +8,5 @@ #import "APContact.h" -@interface APContact () -@property (nonatomic, strong) NSString *firstName; -@property (nonatomic, strong) NSString *middleName; -@property (nonatomic, strong) NSString *lastName; -@property (nonatomic, strong) NSString *compositeName; -@property (nonatomic, strong) NSString *company; -@property (nonatomic, strong) NSString *jobTitle; -@property (nonatomic, strong) NSArray *phones; -@property (nonatomic, strong) NSArray *phonesWithLabels; -@property (nonatomic, strong) NSArray *emails; -@property (nonatomic, strong) NSArray *addresses; -@property (nonatomic, strong) UIImage *photo; -@property (nonatomic, strong) UIImage *thumbnail; -@property (nonatomic, strong) NSNumber *recordID; -@property (nonatomic, strong) NSDate *creationDate; -@property (nonatomic, strong) NSDate *modificationDate; -@property (nonatomic, strong) NSArray *socialProfiles; -@property (nonatomic, strong) NSString *note; -@property (nonatomic, strong) NSArray *linkedRecordIDs; -@end - @implementation APContact @end diff --git a/Pod/Core/Public/Models/APPhoneWithLabel.h b/Pod/Core/Public/Models/APPhoneWithLabel.h index 465ad50..a554cba 100755 --- a/Pod/Core/Public/Models/APPhoneWithLabel.h +++ b/Pod/Core/Public/Models/APPhoneWithLabel.h @@ -10,11 +10,9 @@ @interface APPhoneWithLabel : NSObject -@property (nonatomic, readonly) NSString *phone; -@property (nonatomic, readonly) NSString *originalLabel; -@property (nonatomic, readonly) NSString *localizedLabel; +@property (nonatomic, strong) NSString *phone; +@property (nonatomic, strong) NSString *originalLabel; +@property (nonatomic, strong) NSString *localizedLabel; @property (nonatomic, readonly) NSString *label __attribute__((deprecated("Use 'localizedLabel' instead"))); -- (id)initWithPhone:(NSString *)phone originalLabel:(NSString *)originalLabel localizedLabel:(NSString *)localizedLabel; - @end diff --git a/Pod/Core/Public/Models/APPhoneWithLabel.m b/Pod/Core/Public/Models/APPhoneWithLabel.m index 3aa32f1..c00624d 100755 --- a/Pod/Core/Public/Models/APPhoneWithLabel.m +++ b/Pod/Core/Public/Models/APPhoneWithLabel.m @@ -10,20 +10,6 @@ @implementation APPhoneWithLabel -#pragma mark - life cycle - -- (id)initWithPhone:(NSString *)phone originalLabel:(NSString *)originalLabel localizedLabel:(NSString *)localizedLabel -{ - self = [super init]; - if (self) - { - _phone = phone; - _localizedLabel = localizedLabel; - _originalLabel = originalLabel; - } - return self; -} - #pragma mark - properties - (NSString *)label diff --git a/Pod/Core/Public/Models/APSocialProfile.h b/Pod/Core/Public/Models/APSocialProfile.h index c43059e..3b173ff 100644 --- a/Pod/Core/Public/Models/APSocialProfile.h +++ b/Pod/Core/Public/Models/APSocialProfile.h @@ -7,24 +7,13 @@ // #import - -typedef NS_ENUM(NSUInteger, APSocialNetworkType) -{ - APSocialNetworkUnknown = 0, - APSocialNetworkFacebook = 1, - APSocialNetworkTwitter = 2, - APSocialNetworkLinkedIn = 3, - APSocialNetworkFlickr = 4, - APSocialNetworkGameCenter = 5 -}; +#import "APTypes.h" @interface APSocialProfile : NSObject -@property (nonatomic, readonly) APSocialNetworkType socialNetwork; -@property (nonatomic, readonly) NSString *username; -@property (nonatomic, readonly) NSString *userIdentifier; -@property (nonatomic, readonly) NSURL *url; - -- (instancetype)initWithSocialDictionary:(NSDictionary *)dictionary; +@property (nonatomic, assign) APSocialNetworkType socialNetwork; +@property (nonatomic, strong) NSString *username; +@property (nonatomic, strong) NSString *userIdentifier; +@property (nonatomic, strong) NSURL *url; @end diff --git a/Pod/Core/Public/Models/APSocialProfile.m b/Pod/Core/Public/Models/APSocialProfile.m index 792ea86..d75f5a7 100644 --- a/Pod/Core/Public/Models/APSocialProfile.m +++ b/Pod/Core/Public/Models/APSocialProfile.m @@ -7,65 +7,7 @@ // #import "APSocialProfile.h" -#import - -@interface APSocialProfile () -@property (nonatomic, readwrite) APSocialNetworkType socialNetwork; -@property (nonatomic, readwrite) NSString *username; -@property (nonatomic, readwrite) NSString *userIdentifier; -@property (nonatomic, readwrite) NSURL *url; -@end @implementation APSocialProfile -#pragma mark - life cycle - -- (instancetype)initWithSocialDictionary:(NSDictionary *)dictionary -{ - - if (self = [super init]) - { - NSString *urlKey = (__bridge_transfer NSString *)kABPersonSocialProfileURLKey; - NSString *usernameKey = (__bridge_transfer NSString *)kABPersonSocialProfileUsernameKey; - NSString *userIdKey = (__bridge_transfer NSString *)kABPersonSocialProfileUserIdentifierKey; - NSString *serviceKey = (__bridge_transfer NSString *)kABPersonSocialProfileServiceKey; - _url = [NSURL URLWithString:dictionary[urlKey]]; - _username = dictionary[usernameKey]; - _userIdentifier = dictionary[userIdKey]; - _socialNetwork = [self socialNetworkTypeFromString:dictionary[serviceKey]]; - } - - return self; -} - -#pragma mark - private - -- (APSocialNetworkType)socialNetworkTypeFromString:(NSString *)string -{ - if ([string isEqualToString:(__bridge NSString *)kABPersonSocialProfileServiceFacebook]) - { - return APSocialNetworkFacebook; - } - else if ([string isEqualToString:(__bridge NSString *)kABPersonSocialProfileServiceTwitter]) - { - return APSocialNetworkTwitter; - } - else if ([string isEqualToString:(__bridge NSString *)kABPersonSocialProfileServiceLinkedIn]) - { - return APSocialNetworkLinkedIn; - } - else if ([string isEqualToString:(__bridge NSString *)kABPersonSocialProfileServiceFlickr]) - { - return APSocialNetworkFlickr; - } - else if ([string isEqualToString:(__bridge NSString *)kABPersonSocialProfileServiceGameCenter]) - { - return APSocialNetworkGameCenter; - } - else - { - return APSocialNetworkUnknown; - } -} - @end diff --git a/Pod/Core/Public/Models/APTypes.h b/Pod/Core/Public/Models/APTypes.h index 121d5c2..31cb89b 100644 --- a/Pod/Core/Public/Models/APTypes.h +++ b/Pod/Core/Public/Models/APTypes.h @@ -36,4 +36,14 @@ typedef NS_OPTIONS(NSUInteger , APContactField) APContactFieldDefault = APContactFieldFirstName | APContactFieldLastName | APContactFieldPhones | APContactFieldRecordID, APContactFieldAll = 0xFFFFFFFF +}; + +typedef NS_ENUM(NSUInteger, APSocialNetworkType) +{ + APSocialNetworkUnknown = 0, + APSocialNetworkFacebook = 1, + APSocialNetworkTwitter = 2, + APSocialNetworkLinkedIn = 3, + APSocialNetworkFlickr = 4, + APSocialNetworkGameCenter = 5 }; \ No newline at end of file