Unwind segue and nav button items not triggering after tab bar controller added - ios

I'm trying to implement an unwind segue that will take me from the last view controller back to the todo-list controller.
Here's my storyboard
Without the tab bar controller, the unwind segue works fine. However, as soon as I add the tab bar controller, the unwind stopped triggering.
What am I doing wrong?
Thanks
Edit: Also, actions created on the bar button in the last view controller do not trigger when the tab bar controller is implemented

I have had a similar situation and I was able to resolve it by setting the Modal segue to "Presentation: Current Context" instead of "Default" in the Attributes Inspector (screenshot here: https://cloudup.com/cHFyH8OOY9D).
That is, the segue arrow between the Table View and the second Navigation Controller in your screenshot above.

I've had a similar issue with unwind segues not being called with view controllers within a TabBarController.
The solution is to create a custom TabBarController class, and have the unwind segue action in that class. You will then be able to pass a message to the current tab bar view controller.

Related

Navigation bar missing in storyboard with show segue in Xcode 8

Why can't I see the navigation item under my second View Controller? My setup is as follows: I have a view controller embedded in a navigation controller. This view controller is linked to a second view controller with a "Show" segue. I can select & edit the navigation bar for the first view controller, but cannot see it in the element list for the second view controller. I also cannot edit it in the second view controller (i.e. add a button). How can I fix this?
First, drag a navigation item under your second view controller:
Then, you have it to edit:
How can you link the firstViewController and secondViewController? I try to link and I only can link the firstViewController and secondViewController in there.
But, this link is error, I set the different color for two viewController, the secondViewController cannot display.
So, you lost Navigation Bar? Select the View Controller you want to add and click on Status Bar / Top Bar dropdown list in Attributes
Inspector.
This is a known bug on Xcode, you can manually drag a Navigation Bar to your Second ViewController.

Navigation Controller doesn't appear on Dashboard ViewController

I am using a Navigation Controller in Xcode8, the navigation bar doesn't appear on the following View Controller on the Dashboard. They will appear on the simulator and on the ViewController topDown tree, but nothing on the view of the dashboard.
Navigation Controller Screenshot
Its'a strange problem, It always happen to me too. You can change your segue type to deprecated Push to see nav bar, after that you can change again.
When you connect your navigation controller to the view controller it happens, because it creates segue type to Show. When you change the segue type to Push segue, you can see the Nav Bar on your View Controller.
Just click the segue, you should see the segue options on the right like the picture.
The problem was the segue before the Navigation Controller. When I delete it, all the Navigation Bar come back. Don't know why, but if the problem happen, you just have to delete this segue and then with Ctrl+Z, the segue come back and the nav bar stay

How to show a view controller using a navigation controller segue, including back segue (Swift)

I have to view controller, One has a button and the other is embed in a navigation controller. I Don't know how to make a proper segue to that second view controller including a back (unwind) segue. That is in swift.
You're going to use a navigation controller. Go and select your view in the storyboard, and select Editor -> Embed In -> Navigation Controller. Do the same for the second view. Now, add a button in the first view that connect to the second view on a click. Make sure when you drag and drop that it's a push segue.
Voila! You should now have your navigation controller working.

UINavigationBar disappears when performing segue

I encountered a problem in my app.
I have to have a UINavigationBar in all my pages, and so I created a UINavigationController 'embed in' with my first page. So the UINavigationBar appears on it, but when I perform a segue from that first page (by instating a new view controller and presenting it) the navigation bar doesn't appear on the second view controller.
Check your segue is presenting or pushing a second page.
Check out segue properties, If it's presenting by selection of 'Modal' on segue property of attribute inspector. On presenting view controller you won't get your Navigation bar.
You will get Navigation bar when you push a segue.
And If you want presenting animation on push using segue, You can go for custom segue.
Here is the link.
http://www.appcoda.com/custom-segue-animations/

Segue-ing to Embedded view controller

I have have a view controller that is embedded in a UINavigationController and I want to segue to another view controller that is also embedded in a different UINavigationController. If I try to use a push segue, I get an error saying that I can't push a UINavigationController. However, I don't think using a modal segue is appropriate. How should I go about this?
How should I go about this?
You should use a single navigation controller.
the problem is that I want different bar button items for each view controller and they won't change
Each view controller can set up the bar buttons however it likes. Take a look at UINavigationItem. Each view controller has a navigation item, and the navigation item has various properties such as leftBarButtonItems and rightBarButtonItems that you can use to set the buttons.

Resources