Alterplay / APAddressBook

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

startObserveChangesWithCallback doesn't work in my swift project #81

Closed lyair1 closed 9 years ago

lyair1 commented 9 years ago
        self.addressBook.startObserveChangesWithCallback({() in
            println("Address book change detected")
        })

I added this code to my project, it's never being called. What am I doing wrong?

Thank you very much!

belkevich commented 9 years ago

Are you sure have changes in your address book?)) See example app and use it in your code. It works fine with changes. If it doesn't help, provide more code (APAddressBook initialization, calls). And describe how you made changes in device address book.

romaincointepas commented 9 years ago

+1, it never gets called in Swift.

See this thread for a potential solution: http://stackoverflow.com/questions/25346563/address-book-external-change-callback-in-swift-with-c-function-pointers

belkevich commented 9 years ago

Thank you, for feedback. I'll check it.

laptobbe commented 9 years ago

+1, does not seem to work, have not looked into the workaround yet. Might post a PR when I do.

belkevich commented 9 years ago

Fixed in 0.1.12. I've also updated swift example with 'observe external changes'. You can pull it from develop branch now