I'm trying to keep store datas in my ViewControllerB when I leave it for another ViewController (A or C). 

I don't want to pass datas in each ViewController when I moved but I just want to keep store them in my ViewControllerB. 

I can do a protocol delegate for do it but I think a better way is possible. 

I have this in my ViewController: 

```
var contacts: [[String : String]] = [[:]]

```

And I want to keep this datas which are store inside my dictionnary.

I do it for initialize my Dictionnary.

```
override func viewDidLoad() {
    contacts[0] = ["Name": "Me", "Number": "Hihi I'm not going to show my phone number here"]
    contactsTableView.tableFooterView = UIView()
}

```

When I go on ViewControllerC and then comeback to VCB it's working, my Dictionnary keep values, but when I go to ViewControllerA and then comeback to B my dictionnary is empty. 

For leave ViewControllerC and comeback to B I'm using this method

```
@IBAction func cancelButtonPressed(_ sender: Any) {
    navigationController?.popViewController(animated: true)
    dismiss(animated: true, completion: nil)
}

```

**EDIT: All navigation code:** 

**ViewControllerA to B:**

```
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if segue.identifier == "showContacts" {
        let vc = segue.destination as! ContactsViewController
    }
}

 @IBAction func contactsButtonPressed(_ sender: Any) {
    self.performSegue(withIdentifier: "showContacts", sender: (Any).self)
}

```

**ViewController B to A:**

```
 @IBAction func saveButtonPressed(_ sender: Any) {
    navigationController?.popViewController(animated: true)
    dismiss(animated: true, completion: nil)
}

```

**ViewController B to C:**

```
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    if segue.identifier == "showCreate" {
        let vc = segue.destination as! CreateViewController
        vc.delegate = self
    }
}

@IBAction func addButtonPressed(_ sender: Any) {
    performSegue(withIdentifier: "showCreate", sender: Any?.self)
}

```

**And ViewController C to B:**

```
@IBAction func cancelButtonPressed(_ sender: Any) {
    navigationController?.popViewController(animated: true)
    dismiss(animated: true, completion: nil)
}

```

I've tried to use it for leave B to A but it's not working, I lose my datas. 

How can I keep store values in every case? 

Thanks