Closed spnkr closed 11 years ago
This is a great idea just waiting for you to give it a go. Can't wait to see what you come up with!
Using a predicate sounds like a good way to match different phone number formats but I'm not really sure how performant it is. I guess the best way to find out is to try.
@spnkr, the link you provided just does looping in Objective-C, it's exactly the same thing as Person.all.select {}
.
iOS provides no built-in Address Book search predicate functionality (OSX has this). And iOS also provides no format munging in the API, I haven't noticed if there's anything special in the Contacts app. So please do feel free to fork the repo and see what you can do: you might start with the Person#where
function in address_book/person.rb
and try to add some extra cleverness.
doing a loop--Person.all.select{|p|p....}--is kind of slow, and also doesn't automatically detect things like +12125555555 and 2125555555 being the same number.
is there a better way using this lib?
i.e. http://stackoverflow.com/questions/4272164/how-to-search-the-iphone-address-book-for-a-specific-phone-number
seems to indicate it's possible. i may add it but wanted to see if you'd already given it a go.