Swift - Unable to Show Detail View with Naivgation - ios

I am running into a very strange issue here when it comes to segues between table view controller and details view.
It works with one implementation, but when I followed the same steps (& code) it doesn't work somewhere else.
Basically I have a table populated from Parse backend and once a row is clicked it would show the details for that record. For Orders View Controller, when the row is selected, it shows the detail view with a navigation in top (inherited) and a back button to the list. In the Friends Controller, when I click on a friend row, it shows the details view with details of a friend correctly. But no navigation top bar and no back button.
I also noticed the animation in the Orders scenario is different (left slide) where as in the Friends scenario (not working) it is more of coming from bottom to top.
Below are details to help assess the problem further and am glad to offer more upon request since I am not sure what part is relevant or not.
Now for the Friends scenario:
To illustrate the flow of the order, it goes like this:
I tried doing this but it didn't work:
self.navigationController?.navigationBarHidden = false

I think problem is segue between Friend view and Detail Friend view. Go storyboard and choose segue between them same config with image below:
Hope this help!

Try redoing the segue. Just Ctrl-drag from the prototype cell to the detail view controller. Make sure that you make a segue of type show.

Related

Split Controller master table view pushes to master nav stack not detail

I am trying to set up a very basic Split View Controller. The left side (master) is a table view, which when a row is tapped, I expect to load details into the right side (detail).
I do not know what I'm doing wrong. I have an example project that functions exactly how I want it to, but I'm missing something in my main project. I've very carefully scoured the example project and as far as I can tell, everything is done exactly the same in my main project.
The problem I'm having is, when I tap a cell in my table view, the view controller that is invoked, appears in the master (left side), not in the detail (right side).
My question is: what exactly do I have to do to get the right side to display the detail?
I'm testing on an iPhone 7 Plus Simulator in landscape mode. Portrait mode works fine.
As far as I know I have all the correct delegate setup complete. Thanks in advance!
Wow! Okay, I figured out what was wrong. This has got to be a bug in the storyboard UI, because it does not make sense that this would be the problem.
When I ctrl-dragged from the table view cell to the nav controller so as to create the detail segue, I chose "show". I then realized that it should actually be "show detail", so I went into the attributes of the segue that I just created and changed "Kind" to "Show Detail (e.g. Replace)", which as far as I know, should end up being the same thing as if I would have selected "Show Detail" when creating the segue. It is not.
After a great deal of trial-and-error, I discovered that I had to delete the segue I originally created and re-create the segue, selecting "Show Detail".

Back button does not show up in navigation controller

I have added a show segue from table cell in one view controller to another table view embedded in a navigation controller. When I click on the cell in the first view the segue works as expected and brings up the new view. However, the "Back" button (with the title of the original view) does not appear in the navigation bar.
I searched SO and found a number of such questions asked in the past (both for Swift and Objective-C). Most of them suggest that the first view needs a title for this to work. I do have a title. I even added one programmatically, just in case. That did not help. One of the answers suggested to add an identifier to the segue; that didn't help me either.
How else can I debug this issue?
It seems like the problem is that you are pushing into a totally new navigationController, remove it, and make segue dirrectly into the new view Detail itself, they have to be in the same navigationController to work
Verify you are not hiding backbutton in destination controller...
I had a left bar button item in storyboard removing the button, back button showed up.

Swift: How can I add Up & Down Buttons & Functionality on a Detail View Controller?

I am a neewbie to app development (and coding in general) but enjoying the journey :-)
(I am using Xcode 6.4)
I have a table view controller with prototype cell embedded in a navigation controller..clicking on a row leads to the detail view controller.
Everything working fine.
I'm interested in having up and down buttons on the 'Detail View Controller' to save someone from having to go back up and then down to the next detail again...so they just move between detailed views..
Any pointers... as I can't even drag a button to the nav bar on the detail view controller itself let alone start thinking about how to code the function :-)
Many thanks for your time!
PS can't post a pic of the storyboard as only just joined stackoverflow
I am afraid you are gonna have to do that programmatically.
First, add multiple buttons on nav bar by following this. And hook up these buttons in your detail view controller.
Then, in each of your detail view controller, you need to have some property like previous item, next item. In prepare segue, pass these items from main view controller.
Finally, in the actions of the buttons, load previous/next item.
This is what I can think of based on your description, hope it helps.
Have a next & a previous segue and in the master go to the next/previous row And push detail again.
Do it fast and use no animation and is seamless. We do it eithout story boarding but pop, push the detail vc in the same way.
Better is Chris's answer imho. This may just be less effort ;)

Navigation Controller not showing Root View (just white space)

long time lurker first time poster here. My question is about Navigation Controllers in Xcode 6.1.1.
Basically I've created a feed app that grabs posts from my Wordpress Site and shows them in a table list. When an item from the list is selected, a web view shows the url from the selected item. I want to manage moving between these two views (table and webview) with a navigation controller, so I embedded one into the table list view on my storyboard establishing the table view as the Root. When I run the app, I get a blank screen with an empty navigation bar at the top of the screen (nav controller is set to initial view). I expect to see the list view inside the controller but I get nada. In the past I've been able to do this without writing any code and it's worked no problem.
Not sure why this is happening, but I'm sure it's something really simple that I'm overlooking. Any help would be awesome. Thanks for looking.
Fixed the issue. I knew it was going to be something really small. All I had to do was add a Navigation Item to the Table View Controller. Once I gave the nav item a title, I embedded the Navigation Controller and everything works as expected now.
I got the idea by throwing a navigation controller object onto my story board and cross referencing the canned relationship against my own and that's the only thing that was missing. Thanks for all your help.

Segue from UIViewController to UITableViewController has no effect

The issue I am having is in this particular part of the storyboard. When the table view loads it is populated correctly and everything works fine, then one of the cells can be selected and the view on the right loads up with everything fine(push). However, when selecting 'Back to News' nothing happens(push). If I press the button (nothing happens) and then select one of the other items housed in the tab bar and then select the news tab again the app has returned to the table view and all is well.
The layout can be seen here: http://imgur.com/EaMbM4i
I am not sure what code is needed but can post whatever is requested.
My question is this, what is wrong with segue between the 'Back to News' button and the UITableViewController?
Apologies for any mistakes made, it is my first post.
You dont want to push to the tableview controller again from the news detail view controller.
There will be a back button by default since it is in navigation controller.

Resources