Alterplay / APAddressBook

Easy access to iOS address book
MIT License
1.38k stars 193 forks source link

Error is not called first time if use clicks "Don't allow" #142

Closed zilions closed 7 years ago

zilions commented 7 years ago

If the user decides to not allow access to their contact book, an error is never called.

Although if the app is closed and then reopened, the error is called successfully.

This is the code I am using:

self.addressBook.loadContacts { (contacts: [APContact]?, error: Error?) in
        if let uwrappedContacts = contacts {
            print(uwrappedContacts)
        }
        else if let unwrappedError = error {
            print(unwrappedError)
        }
    }

As stated above, print(unwrappedError) is only ever called if the user has denied access to their contact book AFTER closing and opening the application.

belkevich commented 7 years ago

Fixed. Check out version 0.3.0

P.S. Thank you for issue