1

So I have a problem with my app at the moment. So I have a UITabBarController that has 2 "pages". The first page, called AddExpense (its class is AddExpenseViewController), has a button that segues to a scene, called PicExpense (its class is PicExpenseViewController), that is not linked with the UITabBarController. The problem I am having though, is that when I try to segue from PicExpenseViewController BACK TO the AddExpenseViewController. I am currently using this code to segue back :

performSegueWithIdentifier("segueBackToAddExpense", sender: nil)

This works fine, but the UITabBar is hidden. Here is a picture of my StoryBoard for reference of what I am working with : StoryBoard image here, note that only the AddExpense and Receipt Picture View Controller are relevant in this question, but in the case someone is interested in seeing all of it for their answer or helping me, I took a picture of the whole thing.

I did some research on the same problem, but I already tried those answers like the "Hide Bottom Bar On Push" CheckBox on the View's Attributes Inspector in the StoryBoard. Here is the Attributes Selector View of the Receipt Picture View Controller in my StoryBoard file.

Thanks in advance

Reagan McFarland
  • 295
  • 1
  • 10

3 Answers3

1

Answer: @WilsonXJ found the answer to my problem. I was using normal "Show" Segues, but I needed to use an "Unwind Segue".

Reagan McFarland
  • 295
  • 1
  • 10
0

Try this, let me know if it works.

segue.destinationViewController.hidesBottomBarWhenPushed = true

You could also set this in Storyboard/XIB under Attributes.

Santosh
  • 2,900
  • 1
  • 16
  • 16
0

Maybe,you can use - (nullable UIViewController *)popViewControllerAnimated:(BOOL)animated; or - (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^ __nullable)(void))completion to replace performSegueWithIdentifier("segueBackToAddExpense", sender: nil)

酷酷的哀殿
  • 1,021
  • 6
  • 18