Desired behavior
I am wondering what is the best way to do the following in Swift
- Display contact selection window
- Allow user to select contact
- Get the image from this contact.
Study
When researching this issue, I decided that, starting with iOS 9, Apple introduced a new Contacts structure for accessing contacts. I also found out that Their documentation describes the use of a system called Predicates to receive information from a contact. However, I am not sure how to implement this.
Implementation
Based on this lesson , I figured out how to present the Contact Picker window.
import UIKit import Contacts import ContactsUI class ViewController: UIViewController, CNContactPickerDelegate { override func viewDidLoad() { super.viewDidLoad()
Thanks in advance!
source share