Segue to navigation controller goes black - ios

I am trying to create a segue from a button to a navigation controller that a master view controller is embedded in (I used the "Your Second iOS App" tutorial by Apple Developer). The problem was that whenever I clicked the button, I would get a totally black screen with just a navigation bar. There isn't any code involved. Would anyone happen to know how I could fix this? Any help would be appreciated. Thanks

Actually, I figured it out. It was because the split view controller was also pointing to the master view controller, so it had 2 segues pointing to it.

Related

Implementing a back button without navigation controller

I'm kind of new to programming in swift and in general in xcode. I'm creating my first app and i've run into this issue that i cant seem to find a fix for online..
my first scene is a view controller with two buttons where you pick a language and it redirects you to the appropriate tab controller in that language.. now I'd like to add a back button to those tab controllers in order to go back in case you picked the wrong language.
what I've tried so far doesn't really work..
I have tried using a navigation controller but they dont show on the first view controller so that doesnt help me, ive tried putting just a navigation bar and adding a navigation item (see pictures below) but the back button isnt rendered correctly and cannot be reached..
help is much appreciated !!
You can use first UIView and set top constraint 0 with safe area. See image
Hope it helps.

How to go to tabbar item from an external view controller

Im stuck with a problem me and a friend of mine are building a app in ios. see video.
please watch this video:
https://youtu.be/SHrBF6h8Nso
The problem is when we are done with the workout and we get to the finish workout screen and we click on the profile button it goes to the workoutOverview Screen. But we want it to go to the profileOverview screen.
We try to achieve this with this line of code :
self.tabBarController?.selectedIndex = 1. // this results in segue to workoutOverview instead of profileOverview, no matter what index we use
But finish workoutOverview is not part of tabbar controller or the navigation controller that we have.
the second problem
When pressing the cancel button (cross) we would like to pop to the first viewcontroller (muscleList) but without losing the tabbar!
see how our storyboard is connected in the picture:
Question:
How to go back to profile view controller in the tabbar controller?
How to show view controller with tabbar controller when click on the cancel button?
If anyone have a idea it would help us a lot.
xCode has a bug with the show segues. Change all "Show" segues to the deprecated "Push" segues and build and compile. Than change all back to "Show" again, build, compile and it works now! All viewcontrollers will be added to the stack.

Swift Trouble with using the Navigation Controller

I am trying to add a Back button onto my table view controller (far right VC in the picture). I embeded a Navigation Controller and added a Back Item on the navigation bar with a segue to my second VC. However when I run the code, after I press back on the TableVC, it goes to a blank screen with the Back button still at the top. I want to be able to have the second VC screen when the back button is clicked, but I think there is some funky thing the navigation bar does. I was wondering if there was a way around this.
Ok so I'm pretty sure your problem is your embedding the wrong controller in the nav controller. You want to embed the second view controller in your picture into the nav controller, and then have your last one segue from that view controller.
Also, with a nav controller you don't need to add a nav bar or the back button. The embedded controllers will have these by default.
Embedding controllers is kinda confusing at first so its a good idea to take a look at some additional docs.
Here's a good tutorial that I used when starting out: Tutorial

Navigation Controller & Tab Controller

I'm new to iOS development and I'm feeling kind of lost here.
I'm working on an app idea where I have login/sign up (using Parse) embedded in Navigation controller and then once the user has logged in I want to integrate tab controller as the app interface should be tabbed.
But for some reason it doesn't work properly.
Here's what my storyboard look like:
The problem is that once I login and it redirects me to the Tab controller I see this:
I have NO idea why. Any ideas?
EDIT: Added original images to message
UPDATE: I believe I've screwed up the project somehow. In the very beginning. I've recreated everything from scratch, Added Navigation controllers and now the problem is gone and it everything loads the way it should be!
Your Segue between SignIn controller and TabBar controller must be "Present Modally"
And then if you want use navigation controller after TabBar controller, you must add new navigation controller between your tabs and TabBarController!
If you want to have there tabs with NavigationController, you must add three Navigation Controller...
this is quick Demo for you! Download here!

Navigating to and from a Split View controller

The navigation model I am trying to achieve for my app is the user enters a text and searches and I want to navigate to a split view controller with summary results in the left (master view) of the split view and tapping on it reveal a more detailed info. for that in the right side (detail view) and any interaction/clicks there should navigate out to a hosted webView that can display the web source.
How do I achieve this? I am getting error Split View cannot be pushed from a navigation controller.
FYI: I am newbie to ios/objective-C programming and not familiar if there is an easy way to achieve this.. any feedback/pointers in the right direction would be greatly appreciated!!
UISplitViewController doesn't have to be the root of your app.
You can't push to UISplitViewController but you can navigate it with "Present Modally"
The problem is that the split view controller have to be the root of your app. You cannot push it in a UINavigationController. Whenever you want the split view to appear/disappear, you should change the rootViewController (in the AppDelegate).
However, in your case I suggest you keep the SplitViewController on the screen all the time, and do the search in the master controller. Use a UITableViewController in it. You can add a search bar to your table, and narrow the results as you type characters in the search bar. Hope this helps!

Resources