abaddressbook - Swift playground - Address book - access denied -


is possible test code relating address book api in swifts playground? don't know how give xcode access address book.

this code:

let authorizationstatus = abaddressbookgetauthorizationstatus()  if (authorizationstatus == abauthorizationstatus.notdetermined) {     println("requesting access...")      var emptydictionary: cfdictionaryref?     var addressbook = !abaddressbookcreatewithoptions(emptydictionary, nil)     abaddressbookrequestaccesswithcompletion(addressbook,{success, error in         if success {             //          }         else {             println("unable request access")         }     }) } else if (authorizationstatus == abauthorizationstatus.denied || authorizationstatus == abauthorizationstatus.restricted) {     println("access denied") } else if (authorizationstatus == abauthorizationstatus.authorized) {     println("access granted")     // else } 

it prints me access denied -.-


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -