title: How to display selected contacts into next View Controller in IOS 9(Swift)
body: <p>In Swift I have displayed contacts from my phone using contact UI framework and  I selected particular contacts .After selecting that  I need  to display that selected contacts in the next View Controller. 
  This code belongs to display contacts from contactUI framework. When we run this code it display all the contacts from phone with 2 buttons like done or cancel.When I selects the contact and press the button done it should navigate to another view Controller Plz Provide me a solution for that.</p>
  
  <pre><code>enter code here
  //
  //  ViewController.swift
  //  Spliting
  //
  //  Created by Vijayasrivudanti on 01/11/17.
  //  Copyright © 2017 Vijayasrivudanti. All rights reserved.
  //
  
  import UIKit
  import ContactsUI
  
  class ViewController: UIViewController ,CNContactPickerDelegate{
      let contactStore = CNContactStore()
      var results:[CNContact] = []
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // Do any additional setup after loading the view, typically from a nib.
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
      @IBAction func contact(_ sender: Any) {
          //let dataArray = NSMutableArray()
          let cnPicker = CNContactPickerViewController()
          cnPicker.delegate = self
          self.present(cnPicker, animated: true, completion: nil)
          do {
              try contactStore.enumerateContacts(with: CNContactFetchRequest(keysToFetch: [CNContactGivenNameKey as CNKeyDescriptor, CNContactFamilyNameKey as CNKeyDescriptor, CNContactMiddleNameKey as CNKeyDescriptor, CNContactEmailAddressesKey as CNKeyDescriptor,CNContactPhoneNumbersKey as CNKeyDescriptor])) {
                  (contact, cursor) -&gt; Void in
                  self.results.append(contact)
                  ///let data = Data(name: contact.givenName)
                  //self.dataArray?.addObject(data)
              }
          }
          catch
          {
              print("Handle the error please")
          }
  
      }
      func contactPicker(_ picker: CNContactPickerViewController, didSelect contacts: [CNContact]) {
          contacts.forEach { contact in
              for number in contact.phoneNumbers {
  
                  print("The number of \(contact.givenName) is: \(number.value)")
  
          }
        }
      }
  
      func contactPickerDidCancel(_ picker: CNContactPickerViewController) {
          print("Cancel Contact Picker")
      }
  
  
  
  }
  </code></pre>