I am using swift to perform segue programatically. First, I created a segue between two controllers in storyboard. Below is the code to show a view controller:
self.performSegueWithIdentifier("EditImage", sender: imageSampleBuffer)
When executing the above code, a new controller view will be presented on the UI. Then I click the "back" button on the top-left corner. The ui will come back to the previous view. It works fine here. But when I profile my app with instrument I found that the controller(pointed by "EditImage" segue) not released. When I click the controller instance on instrument, it shows that the above code is referencing this controller instance. When I perform these two controller back and forth, the instance number of that controller keep increasing. I didn't create any action function for the "back" button. All uses the default logic with navigation controller. So how to release controller when come back? Should I write any code on go back action?