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".
Related
GroupMe is a good example. I want to implement something similar to this..
when you press the top left icon it'll bring you to the view on the left hand side, and when you click the right hand side of that view (the chats) it will bring you back
As the documentation says:
Use segues to define the flow of your app’s interface. A segue defines
a transition between two view controllers in your app’s storyboard
file. The starting point of a segue is the button, table row, or
gesture recognizer that initiates the segue. The end point of a segue
is the view controller you want to display. A segue always presents a
new view controller, but you can also use an unwind segue to dismiss a
view controller.
As said by Apple© segues are for changing View Controllers only and cannot be used to move single views. I suggest using animations to achieve the effect you are searching, however segues are definitely not what you are looking for. Maybe this question on stackoverflow.com may help you.
And please be sure to check for information by yourself first, I got this information in less than 5 minutes by searching on Google.com.
Regards -Jorge
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.
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.
I created a Xcode project using the tabbed application template. Currently, when the app is started, it immediately switches to the First View Controller. I would like to change it to go to the Second View Controller instead. I've looked at the Tab Bar Controller for attributes. The only thing I see is under the Connections inspector/Trigger Segues/view controllers shows a list of View Controllers (First, Second, Third). Does anyone know how to change the automatic switch? iOS 8/Xcode 6.1
There are two ways to do this.
Firstly, there's an arrow at the left of the Initial View Controller. You can drag this arrow to any other view controller and that will become the initial controller.
Secondly, you can click on the view controller, go to the Metrics tab in the inspector (the one with the downward pointing thing) and then check the option that says "Is Initial View Controller".
The answer to this question is: Delete the First connection listed under the identity inspector and then re-add it. This bumps the second one up to the first place and positions it where I want it.
I'm mainly from a C# background, so the workflow for iOS is a bit unusual for me, at least for now.
I was having a problem having simple segue from a main menu, to a another menu/work area, and then with the ability to go back to the main menu.
For a test, apparently I did something wrong.
I didn't write any code for this test to exhibit the problem.
What I did was just,
create a new single-view app
drag an additional view controller onto the work area
drag the start arrow to the new view controller (so it becomes the initial view, same thing as checking the checkbox to set it as the initial view)
added a button to each view controller
Ctrl + clicked and dragged the buttons to the opposing view
for the segue type, I chose "replace"
now the program crashes if I hit the second button to go back to the "main menu" (green view controller in this example)
So what am I doing wrong? Do I need to add some form of delegate or something?
I did find this, though it present fewer segue options in the tutorial than what I have.
https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/SecondTutorial.html
These are the options I have when I Ctrl + Click from a button to another view
-Push
-Modal
-PopOver
-Custom
-Replace
"Have you embedded a navigation controller? You need to go to editor->embed in-> Navigation Controller. You need a navigation controller for push segue. – Kaushal Bisht"
This solved it for me. Now I'm just going to work on replacing the navigation bar with custom UI controls.
Thanks everyone! :)