2

Whenever I try presenting a view controller overtop the new iOS 9 CNContactPickerViewController, it is immediately dismissed. Here's the relevant delegate method code:

public func contactPicker(picker: CNContactPickerViewController, didSelectContact contact: CNContact) {

    let v = UIView(frame: CGRectMake(0, 0, 100, 100))
    v.backgroundColor = UIColor.redColor()

    let vc = UIViewController()
    vc.view.addSubview(v)

    picker.presentViewController(vc, animated: true, completion: { () -> Void in print("labeled value picker displayed") })
}

As soon as the message labeled value picker displayed appears in the log, the screen flashes and my vc with the red subview is dismissed. Here's what it looks like when I select John Appleseed, then Kate Bell from the list.

enter image description here

It's like iOS 9 doesn't like this and dismisses the view controller automatically.

Can anyone confirm that this behavior shouldn't be allowed or if this is a bug in iOS 9? Previously with the AddressBook Framework you could present another view controller over the picker view controller.

Edit:

Here's the 2015 WWDC Video that covers the overview of these new frameworks. Unfortunately, it can only be viewed in Safari: https://developer.apple.com/videos/play/wwdc2015-223/

Aaron
  • 7,055
  • 2
  • 38
  • 53

0 Answers0