This seems to appear on two controllers in our project. I checked both code and storyboards and the segue in the storyboard is NOT called in the controller, there is no IBAction nor IBOutlet related to the buttons that will trigger the segue. Though when i leave my controllers i can see from a print that the deinit method is called twice.
This is weird since viewDidLoad and viewWillDisappear are only called once, did anyone encounter this behaviour before? There is nothing related to a double deinit on SO and i would like very much to understand what is going on.
Edit : So, little update. I added this bit of code which i set a breakpoint on to check when the controller is init :
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
required init(coder aDecoder: NSCoder) {
print("init coder style")
super.init(coder: aDecoder)!
}
So init coder is called ONCE when i trigger the segue to get to my controller, and when i tap on the ok button of said controller which is plugged to a popSegue, my controller is then init a second time (also with init coder) and then the double deinit happen.
So what happen is that an empty instance of my controller is created when i dismiss it with a popSegue. I fail to understand why though.