0

good evening,

today i start programming of my first macOS program in swift. unfortunately i find no tutorial which can solve my issue.

i have a view controller with an "abpeoplepickerview". this shows me successfully my mac address book contacts.

now i would like to select an person an get all details of this person which i would like to fill into textfields.

but i don't know how. can everybody helps me (please step by step)

thank you very much :)

Stack108
  • 915
  • 2
  • 14
  • 35
  • 1
    The [Contacts framework](https://developer.apple.com/reference/contacts) is the same in iOS and macOS. – vadian Apr 23 '17 at 18:40

1 Answers1

0

You get selected contacts with ABPeoplePickerView.selectedRecords.

Then you iterate through it with foreach. You may want to check if the record is ABPerson before casting the record to it. After that you read the properties from ABPerson and display them in the text fields.

Ivan Ičin
  • 9,672
  • 5
  • 36
  • 57