segue

NSInvalidArgumentException reason Receiver has no segue with identifier

空扰寡人 提交于 2019-12-20 18:14:12
问题 I have problem I've been sitting with. I have a UIViewController List and a UIViewController Login . On Login I have a button "Done", also another hidden button on the same UIViewController that has a segue to List (Type: push). I gave it an identifier in the interface builder of xcode named "LoginToList". Now from another class (a class that runs while Login is the active controller) I call: [[Login sharedLogin] performSegueWithIdentifier:@"LoginToList"]; The Login class clearly has a segue

Perform Segue Programmatically Without Button Connection?

我的梦境 提交于 2019-12-20 10:23:32
问题 I have two view controllers in my storyboard and I need to push from view 1 to view 2. I need to do this without connecting a segue directly from a button in my storyboard, I need to do it programatically. How can I? Thanks. 回答1: When you click the button call: [self performSegueWithIdentifier:@"SegueIdentifier" sender:self]; You will need to create the segue in the storyboard but you can do it from view controller to view controller instead of button to viewcontroller. 回答2: If you want to

How to insert a override function into a if else statement

故事扮演 提交于 2019-12-20 06:43:35
问题 I realize that with basic logic I cannot put a override function into a if else statement because it will override everything. However i still need to put in the if else statement the prepare for segue. So the way the code I am working works is if a user hits a button twice they win the game and therefore go to the winners view controller where a score is displayed. If they lose they go to a view controller with no score. So I need to put the override function segue in updateTimer() , In the

Page views not correctly sized after segue

会有一股神秘感。 提交于 2019-12-20 06:24:17
问题 I recently updated my XCode to version 11.0. Ever since the update segues on an old project have been behaving weirdly. When I segue modally to a new page the page does not fill the entire screen and seemingly hovers instead. Here is a picture of the view: https://imgur.com/dAxEr4q I would like for the pages to take up the full length of the device screen as they did prior to the upgrade. Thanks in advance for any assistance. 回答1: This has to do with the new default modal presentation style

Same view controller loads twice

喜夏-厌秋 提交于 2019-12-20 05:01:19
问题 I've read several posts on this issue but none of them solved my problem. I'm coding an app where I have to click on a button ("Prepare") to go to the following ViewController. When the button is clicked, it also passes data between the two view controller. The problem is, when I click the button, the following ViewController loads twice. Thus, if I want to go back I have to go back through two same ViewController. I've checked the segue, the class names and files names but nothing fixes it.

How to execute button press action before prepareForSegue in iOS?

假装没事ソ 提交于 2019-12-20 04:15:17
问题 I am creating an iOS application in which I want to perform an assignment action in button press before running the method prepareForSegue. I created all controls using Main Story board. The order of execution for some buttons is button press action -> prepareForSegue but for some buttons it is prepareForSegue-> button press action How to change the order for second set of buttons? Here is the code I am using: import UIKit class SummaryViewController: UIViewController { override func

My Tab bar controller disappears after a push segue

陌路散爱 提交于 2019-12-20 04:10:16
问题 Here is the setup of my app: Navigation- -loginVC -if login is valid, pushes segue to- tab bar controller with 3 tabs: -in the first tab, is a profile display which modal pushes to a profile editor(not issue here) -second tab is a searchVC that pushes to a tableVC that shows results. This is where the tab bar disappears -The third view is just a VC for updating the database this is linked to. This is literally how it works on the storyboard, and I've made sure the segue from the searchVC to

How do I pass data between two scenes in Swift?

家住魔仙堡 提交于 2019-12-20 03:26:18
问题 I have two scenes where I would like to pass a single variable to another scene using a segue. I have tried but unfortunately all tutorials I have seen are dealing with the storyboard. I am not using the storyboard. I am doing all of this programatically. Here is the segue i am trying to initialize: func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) { if (segue.identifier == "segueTest") { var lose = segue.destinationViewController as! loserScene; lose.toPass = scoreLabelNode

pass data to view controller using storyboard segue iOS

a 夏天 提交于 2019-12-20 01:40:05
问题 I know there are lots of postings about this but I have tried everything and nothing has worked. So I have tried to pass an object between two view controllers, to a DBKIngredientsViewController embedded in a navigation item. I have a push segue with the identifier "showIngredientsSegue" to the DBKIngredientsViewController. The error message I receive is: 'NSInvalidArgumentException', reason: '-[DBKIngredientsViewController topViewController]: unrecognized selector sent to instance 0x8a92450'

How do I use prepareForSegue in swift?

。_饼干妹妹 提交于 2019-12-19 20:00:08
问题 I have a ViewController with tableview called BasicPhrasesVC and I want to pass the data in the selected cell to display it on the next ViewController (called BasicPhrasesVC). class BasicPhrasesVC: UIViewController, UITableViewDataSource, UITableViewDelegate { let basicPhrases = ["Hello.","Goodbye.","Yes.","No.","I don't understand.","Please?","Thank you.","I don't know."] var selectedBasicPhrase = "" func numberOfSectionsInTableView(tableView: UITableView) -> Int { return 1 } func tableView