I`ve one ViewController to which I can hit by clicking on TabBarItem or from Table View Controller B by pressing plus on navigation bar.
My problem
How, by clicking on the Cancel button on the ViewController, I can go to Table View Controller B if I hit to ViewController from Table View Controller B by clicking plus or go to Table View Controller A if I hit to ViewController by selecting the second (blue) tab bar item?
I want set two action to Cancel button on the ViewController - depending on the previous Controller I want to go to TableViewControllerA or TableViewControllerB, is it possible?
Details
First version of the transition: By clicking Plus button on the TableViewControllerB I go to ViewController and on ViewController I click Cancel button and return to TableViewControllerB.
Second version of the transition: By clicking second TabBarItem on the TabBar Controller I go to ViewController and on ViewController I click Cancel button and return to TableViewControllerA.