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

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -