Thanks for checking out my post. I have an program which starts in a Navigation Controller and goes to a Table View Controller. My app requests access to the user's contacts.
When asking for permission from user it is preventing the cells in the Table View from filling with the appropriate information (the cells are completely blank, and there are only about 10 cells when there should be about 700).
When the program already has permission to access the contacts the cells in the Table View fill correctly and I have no issues.
I call the determineStatus()
function from the viewDidLoad()
of the TableViewController. Is this causing issues because I have to wait on authorization from the user? Please let me know if you need additional information. Thanks ahead of time!
func determineStatus() {
let status = ABAddressBookGetAuthorizationStatus()
switch status {
case .Authorized:
//this function gets the contact names
getContactNames()
case .NotDetermined:
ABAddressBookRequestAccessWithCompletion(nil) {
(granted:Bool, err:CFError!) in
dispatch_async(dispatch_get_main_queue()) {
if granted {
//this function gets the contacts names
self.getContactNames()
}
}
}
case .Restricted:
//
case .Denied:
//
}
}