CNContactPickerViewController for Xojo
You may know that our MBS Xojo Plugins contain classes for Contacts for macOS and iOS. And now we add a new CNContactPickerViewControllerMBS class, so you can use the standard picker on iOS to pick a contact.
You subclass the CNContactPickerViewControllerMBS class and fill the events or use addHandler to connect the events to your methods. There is didCancel event in case user presses cancel button and there are events for one (or multiple) contacts selected or contact properties. Depending on which event you implement, the picker will be single or multi selection and may show contact properties.
So let's subclass and fill the events:
Next we want to use it. So in your screen, view or button subclass, you can just make a new picker object and keep it somewhere. Since all processing asynchron, please keep a reference stored some. To show we simply call Present method:
Once you pick a contact or cancel, the dialog closes automatically an you can continue to work with the CNContactMBS or CNContactPropertyMBS object. Please try with 22.3pr2 or newer.
