ios - Adding and Saving New Contact to AddressBook -



ios - Adding and Saving New Contact to AddressBook -

i have problem can't quite seem solve though i've used resources i've found on google , on here. i've started beingness taught swift , how utilize xcode month ago, hence, i'm new, , problem have simple others.

what i'm trying add together , save new contact addressbook. can app contacts app no problem, it's can't save new contact information.

import addressbookui import addressbook class viewcontroller: uiviewcontroller { @iboutlet weak var contactlink: uibutton! @ibaction func contactlink(sender: anyobject) { var viewcontroller: abnewpersonviewcontroller = abnewpersonviewcontroller() self.presentviewcontroller(viewcontroller, animated: true, completion: nil) } }

here's code i'm using relates problem. assistance appreciated.

the swift code is:

import addressbookui class viewcontroller: uiviewcontroller, abnewpersonviewcontrollerdelegate { @ibaction func contactlink(sender: anyobject) { allow controller = abnewpersonviewcontroller() controller.newpersonviewdelegate = self allow navigationcontroller = uinavigationcontroller(rootviewcontroller: controller) self.presentviewcontroller(navigationcontroller, animated: true, completion: nil) } func newpersonviewcontroller(newpersonview: abnewpersonviewcontroller!, didcompletewithnewperson person: abrecord!) { newpersonview.navigationcontroller?.dismissviewcontrolleranimated(true, completion: nil); } }

see prompting user create new person record section of address book programming guide: user interaction: prompting , displaying data.

ios swift addressbook addressbookui

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -