Here is a picture of my storyboard:
I assume the problem is because the segue is coming from a custom table view cell. The button will send information based on the cell selected. When I press the button, I just perform the segue with identifier. Unfortunately, the navigation bar does not appear, and I can't imagine why its not appearing.
Any help is greatly appreciated!
EDIT: Here is the storyboard segue. It is push:
EDIT2: Here is the code I am using to perform this segue:
func buttonAction(sender: UIButton!) {
segueIndex = sender.tag
performSegue(withIdentifier: "segue_show_job", sender: self)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "segue_show_job" {
let nextVC = segue.destination as! PlaceBidTableViewController
nextVC.job_info.job_info = self.job_arr_arr.job_info_arr_arr[segueIndex]
}
}
ANSWER:
Maximo and XCoder, thank you for your help. Even though my segue was push, something must have been corrupted. I deleted the segue and re-created it and it worked! Thanks!
Make sure use Push in your view. This is what suppose to be.
This make your navigation bar not show up.
Maximo and XCoder, thank you for your help. Even though my segue was push, something must have been corrupted. I deleted the segue and re-created it and it worked! Thanks!
Related
I'm trying to segue into a 'settings' View Controller by clicking a button, and I'm assembling it via code but don't know what I'm doing wrong.
This is my button code:
#IBAction func settingsButton(_ sender: UIButton) {
self.performSegue(withIdentifier: "SettingsViewController", sender: self)
}
The View Controller is called 'Settings View Controller' (unsurprisingly). The app crashes whenever I press on it in my Simulator.
It'll probably be a simple thing, but any ideas what I'm doing wrong?
You must set your segue identifier whatever you want (for your question = SettingsViewController) from storyboard :
Hope it helps...
I just recently started coding again after about four months. There were a few updates in between. When I went to work on my app I clicked on a link and noticed the new view was hovering over the last view and there was no status bar. Just wanted to know what is causing this to happen and how to fix? Thanks
self.performSegue(withIdentifier: "Recover=>SignIn", sender: self)
override func prepare(for segue: UIStoryboardSegue, sender: Any!) {
if(segue.identifier == "Recover=>Connection") {
let navController = segue.destination as! UINavigationController
_ = navController.topViewController as! Connection
}
}
iOS 13 changed the way view controllers are presented by default. If you are using something like
parentViewController.show(childViewController, sender: self)
In iOS 12 the child view controller used to be shown full screen. In iOS 13 it shows up hovering over its parent.
To make it show up full screen, you need to add one line above the show():
childViewController.modalPresentationStyle = .fullScreen.
I'm segueing to a view linked with a UINavigationController, but the UINavigationBar doesn't appear. There is no sign of the UINavigationController whatsoever.
My StoryBoard looks like this:
To perform the segue, I'm using this:
self?.performSegue(withIdentifier: "practicemod", sender: self)
The preparation function looks like this:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
var vc = segue.destination as! PracticesView
vc.practices = sdkPractices
vc.consumer = sdkConsumer
}
Can someone help me out here? What am I missing?
The start point in your storyboard need to be Navigation Controller.
OR
segue from select view to Navigation Controller to TableView Controller (PracticesView).
This should solve your problem
I am currently using a walkthrough view controller to show a "getting started" carousel when you first open my app. Once you select get started, there are two buttons at the bottom that direct you to login as one of two types of users:
However, As you can see here there is no back button to take you back to the page where you decide what type of user you are. Here is the code I am using to segue:
override open func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let NavViewController = segue.destination as! UINavigationController
let NextViewController = NavViewController.topViewController as! LoginViewController
if(segue.identifier == "client") {
NextViewController.request = 0;
} else {
NextViewController.request = 1
}
}
In addition, I have added titles to all of the other view controllers in their viewDidLoad() methods. If anyone has an idea of why the back button isn't showing, I would greatly appreciate your help!
Question has been answered by Grundewald. Solution: The navbar needs to begin before the initial segue. Thank you for your help!
I have been following this tutorial: http://www.totem.training/swift-ios-tips-tricks-tutorials-blog/ux-chops-dim-the-lights
However I have edited it slightly so that I can specify different Segues and also do it programmatically.
The problem occurs when I close the popped up view. When I close it, the background dim stays there:
What I did to the project files:
files: (https://github.com/TotemTraining/DimBackground.git)
1) Deleted the Segue that was there
2) Created an IBAction for the button named clickedButton
3) Created new Segue from first VC to second Named the Segue testSegue
4) Added this code for the IBAction:
#IBAction func clickedButton(sender: AnyObject) {
performSegueWithIdentifier("testSegue", sender: self)
}
5) Changed the prepareForSegue to:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if (segue.identifier == "testSegue") {
dim(.In, alpha: dimLevel, speed: dimSpeed)
}
}
Now, When I run it, it shows the popup the desired way however when I click the close it removed it but leaves the "Dim" there. Can anyone see why?
The view is going to have several segues from it and I only want a few of them to have this "dim" effect.
Edit:
If I take out the if (segue.identifier == "testSegue") so its now:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
//if (segue.identifier == "testSegue") {
dim(.In, alpha: dimLevel, speed: dimSpeed)
//}
}
it works as desired, so is it something to do with that?
It sounds like your unwind isn't getting called in order to dim out. Have you set a breakpoint to make sure? Also, if you are using Xcode 8, there was a weird bug with unwind segue names. They automatically got appended with "WithSegue:" at the end of them, so double check that it is labeled correctly in Interface Builder.