I recently started learning Swift and for my first app (Master-Detail Template), I am trying to pull data (add contacts to a list) from my Address Book. I am trying to connect my showAddressBook method to the + button in the Master. The build fails on the init line (error: "Initializers may only be declared within a type"), so I'm guessing my code is wrong.
func showAddressBook() {
var addressBookController = ABPeoplePickerNavigationController.alloc()
init(addressBookController = ABPeoplePickerNavigationController) {
self.addressBookController = presentViewController(presentViewController: addressBookController, animated: true, completion: nil)
}
}
I can upload the code for connecting Address Book data if necessary. Thanks!