Master-Detail View, Getting a "back" call in the detail view - ios

What I have is a Master view that is embedded in a nav controller and when you push a button it navigates to a different master view and causes a replace segue for the detail view.
What I would like is when the automatic "back button" is pressed, the detail view goes back to the "title" version which I'm using as a splash screen.
Things I've tried so far
Delegating UINavigationBar
Manually forcing a segue when the Master view associated with it's "linked" detailview goes off screen

Okay, figured it out.
Need to get the "splash page" to call the segue. I did do this, BUT I did it with "replace" type, which doesn't allow for "pop" transitions

Related

Losing #IBOutlets after Segue

I'm working with the Xcode view editor and Swift.
I have my main view which contains a tab bar controller with 2 tabs.
On the second tab, I have a #IBoutlet var myLabel: UITextLabel!. Inside viewWillAppear I put some text in this label.
On the first tab, I have a button which launch a third view through a Push segue, and on this new tab, I have a Back button which gets me back to the main view containing a tab bar controller (through a push segue too).
When I launch my app, go in my second tab, the text of the UITextLabel is changed.
I still can go to my first tab and navigate between them it works.
But the problem is when I click on my first tab's button, then on Cancel, then goes back to my second tab, my UITextLabel doesn't change. And I can't perform any action on it anymore. It's not nil though but it's like it's still connected to the first UITextLabel before the segue and not this one.
Where am I wrong ?
Several things are wrong.
With tabbed apps, Apple says that the tab bar controller should be the root level navigation method for the app. It should always be present, and the user should always be able to tap another tap to switch to another part of the app.
So the first tab should connect to a navigation controller. When the user pushes the button, you should push a new view controller onto that navigation controller. The tab bar will still be visible and enabled, and the user will still be able to switch to view controller one.
Next thing:
You say "I have a Back button which gets me back to the main view containing a tab bar controller (through a push segue too)."
That's very wrong. Back buttons should pop a view off of the current navigation stack. They should not be pushing anything. Any time you use a push segue, you are creating and pushing a brand new instance of a view controller, and leaving the other view controllers in the navigation stack.

How do I jump to say, the second view controller in my navigation controller at app launch?

Like many apps, I have a main screen in my app that I want the app to launch to, but they also have the option of going back a screen to somewhat of a "home" view. I don't want to present this modally, as it is technically "before" the view controller they launch at.
So if my navigation controller has this first "home" view controller, then the "main" view controller after that (then some others after that...) how do I start the app at the second, main view controller and still allow them to easily press back to go home?
I tried setting my "Initial view controller" in my Storyboard to the second one, but it doesn't seem to work as it doesn't show the navigation bar and seemingly won't allow you to go back.
I'd recommend setting the "home" view controller as the "Initial view controller", but then segueing to the "main" view controller in the viewDidLoad or viewWillAppear of your "home" view controller; that way, unlike in Mike's answer, you can dismiss that "main" view and go back to the "home" view before it such that it's the only view controller on the stack.
You should make the second viewController the initial view, then make a UIBarButton on the second viewController, to let the user go back.

The TabBarItem disappear when I push in other view

I have a TabBarApplication with four views in the main TabBarItem. The problem comes when I go to any of these views and click in any button to go to another view and when I go back by a button linked to the main view, the TabBarItem of the app disappear!!
For example, one view of the app is a tableView in which each element of the list is linked to his external view and it has a back button that should return to the tableView. All the segues are by modal, not push because push segue crash the application and by modal it runs correctly but the problem comes when I returned by clicking the back button of the NavigationItem in the header of the view to his main view and the TabBarItem of the app is not there, is empty.
Each tab should have the view controller set to a navigation controller, with the view controller you want set as the root view controller of the navigation controller. Now you can use push segues and the standard back button that will be added for you. This will bypass the issue (and work much better for you and users).
You current issue is likely related to not really ever going back. Instead, just always presenting new modal view controllers which replace any existing content on screen.

Creating an initial view before displaying views with UITabController

I am creating an app that uses a UITabController with 5 tabs for navigation. Right now my app loads the first tab as the initial view upon app loading.
I want to be able to change that so I have a view that doesn't use my UITabController as the initial view, and once they click the one button on it, it brings them to the First View and displays the TabController.
I thought I'd simply set up a new view, change that one to the initial view controller and have a segue from the button to the TabController, but when I tried that and the view I wanted to with the button loaded first, but when clicking button it said something about needing to set up a NavigationController? Not sure what to do from here.
I think it's best to leave your tab bar controller as the window's root view controller. You can present the initial view controller from the viewDidAppear method of the controller in the first tab, using presentViewController:animated:completion:. Do this with the animated parameter set to NO, and the initial view will be the first thing the user sees. When you're done with that view, just dismiss it, and you'll be back to the first tab's view.

Maintaining popover across multiple detailviews in UISplitView

In my app delegate I create a UISplitViewController. I set the delegate to be the detailViewController.
When I run my app in portrait, I have the left top popover button showing that will slide out the split view master.
Then I have a button in my detail view that resets the splitviewcontroller array with a new detail view controller and sets the split view delegate to that controller.
The second detail view displays properly... but I lose my popover button on the second view controller.
Does anyone know how I can get that button to remain on all of my detail view controllers I may add?
Thanks!
See http://www.raywenderlich.com/forums/viewtopic.php?f=2&t=1546 for what I find to be a good approach.
It involves setting the SplitViewController delegate to be the master instead of the detail. The master keeps references to the popoverController and the button, and each time the delegate methods are called (hide and show master) it gets the current detail view and performs the necessary action (add in the button/remove button and popovercontroller).
The master defines a protocol for "SubstituableDetailView" which contains the two methods for showing/hiding the button.

Resources