ios8 - AddressBook and Contacts framework in iOS 8.0 and 9.0 -


i trying build app fetches contact list users contacts , renders in custom ui of app. want support ios 8 , ios9 problem methods of addressbook framework deprecated in ios9 , contacts framework not support ios 8.0. there's way can support both 8 & 9 this?

thanks in advance!

you have implement both code, if want support both ios versions.

you have check ios versions below, objective-c

nscomparisonresult order = [[uidevice currentdevice].systemversion compare: @"9.0" options: nsnumericsearch]; if (order == nsorderedsame || order == nsordereddescending) {     // os version >= 9.0     // call contact address book function } else {     // os version < 9.0     // call address book function } 

for swift,

if #available(ios 9.0, *) {     // os version >= 9.0     // call contact address book function } else {     // os version < 9.0     // call address book function } 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -