APAddressBook icon indicating copy to clipboard operation
APAddressBook copied to clipboard

Question: APAddressBook support at iOS9?

Open vorti2 opened this issue 8 years ago • 9 comments

Hi,

ABAddressbook is a nice add on to the Addressbook framework. Exist plans to support the new Addressbook stack in iOS9?

vorti2 avatar Sep 09 '15 09:09 vorti2

Hi,

The short answer is YES)) I'm working on thread safety now (version 0.1.12). Then I'm going to review APContactField and replace it with something else (version 0.2.0). And then I'll do research on new AddressBook.framework. It looks pretty different from ABAdressBook.framework. So, I should find some common interface that will fit both frameworks (version 0.3.0).

belkevich avatar Sep 09 '15 11:09 belkevich

Nice to hear ...

vorti2 avatar Sep 09 '15 12:09 vorti2

If you use twitter, follow @okolodev. I post release news there.

belkevich avatar Sep 09 '15 12:09 belkevich

after upgrade to Xcode 7 GM, following code breaks with error "Binary operator '|' cannot be applied to two 'APContactField' operands":

let addressBook = APAddressBook()
addressBook.fieldsMask = APContactField.Default | APContactField.Thumbnail | APContactField.Emails | APContactField.Phones | APContactField.APContactFieldRecordID

any idea how to fix it from my end?

edit: my bad

should use

let addressBook = APAddressBook()
addressBook.fieldsMask = [.Default, .Thumbnail, .Emails, .Phones, .RecordID]

this Swift madness, god

chrischenyc avatar Sep 15 '15 00:09 chrischenyc

this swift madness not working for me after updating to 0.2.0 version

self.addressBook.fieldsMask =   [.Default, .Emails, .PhonesWithLabels, .RecordID]

Any ideas ? thanks

Edit : my bad .Emails and .RecordID does not exist anymore. Error message was not helping

batical avatar Oct 06 '15 20:10 batical

Hacky, but when I couldn't OR the fields masks in Swift 2.0, this is what I did with rawValue to make it work in 0.1.11:

    // Some Swift2 changes here, because I could not "OR" the APContactField masks
    let fieldsMask = APContactField.Default.rawValue | APContactField.CompositeName.rawValue | APContactField.Emails.rawValue | APContactField.Thumbnail.rawValue
    addressBook.fieldsMask = APContactField(rawValue: fieldsMask)

stevengharris avatar Oct 06 '15 21:10 stevengharris

@batical please, read 0.1.x to 0.2.x migration guide @stevengharris check the swift example app

belkevich avatar Oct 07 '15 08:10 belkevich

support at iOS7 ?

techistoner avatar Dec 03 '15 02:12 techistoner

@techistoner APAddressBook is supporting iOS7

belkevich avatar Jan 04 '16 10:01 belkevich