swiftuinavigationbaruinavigationitemuibuttonbaritem

Nav BarItem Returning To Previous View


In the below figure, I have a "Back" button in the nav bar which I would want for it to close the Barcode Scanner tab and bring me to to the view I was prior to hitting the "Back button. How would that be possible?


Solution

  • Your request is improper UI. Tabs should not contain back button for going to previous tab, and I really hope that 'Close' the tab doesn't mean you want to remove it.

    Other than that you can change active tab UITabBar.setSelectedItem. But really in your case don't do it.