segue

How to segue from one viewcontroller to another

自闭症网瘾萝莉.ら 提交于 2020-01-05 01:50:27
问题 I have a problem about the segue if signupError == nil { println("logged in") self.performSegueWithIdentifier("segue", sender: nil) } else { if let errorString = signupError!.userInfo?["error"] as? NSString { // Update - added as! String error = errorString as! String } else { error = "Please try again later." } self.displayAlert("Could Not Log In", error: error) } else { if let errorString = signupError!.userInfo?["error"] as? NSString { // Update - added as! String error = errorString as!

How to navigate to different view controllers based on slide out menu

£可爱£侵袭症+ 提交于 2020-01-04 06:01:14
问题 I'm new to Swift and have been trying various thing for many hours now. Here's how my app looks like: Ideally I want them to click an option from this pop out menu that will take them to another view. Right now, I'm on the QuotesTimelineViewController but say I want to click on the bookmark button then I'd want to go to the SavedQuotesViewController. Here is how my storyboard looks like: The QuotesViewController has a NavigationController embedded in it. When you click the menu button it goes

Pushing a navigation controller is not supported error message

邮差的信 提交于 2020-01-03 18:13:39
问题 I am working on an app where the user has the possibility to add products and those products are then displayed in a TableView. I created a TableViewController with static cells and two sections and I want to hook the cell in the second section with another TableViewController. I dragged the TableViewController from the object library, embedded it in a navigation controller and made a push segue from the cell to the NavigationController but when I try to run the app I get the following error

Having problems with Xcode 8.1 and unwind segues

别说谁变了你拦得住时间么 提交于 2020-01-03 16:55:53
问题 I can't get unwind segue to work with the latest Xcode 8.1 GM. I'm just wondering if I'm the only one, or someone else is experiencing the same. I have set up the view-controllers as before, it worked in Xcode 8.0, but now I'm having no luck. Tried to clean and so on, but nothing helps. I would like someone else could test it as well before I file a radar... The view controller that first instantiated the view controller is having the following code: @IBAction func

Having problems with Xcode 8.1 and unwind segues

十年热恋 提交于 2020-01-03 16:54:29
问题 I can't get unwind segue to work with the latest Xcode 8.1 GM. I'm just wondering if I'm the only one, or someone else is experiencing the same. I have set up the view-controllers as before, it worked in Xcode 8.0, but now I'm having no luck. Tried to clean and so on, but nothing helps. I would like someone else could test it as well before I file a radar... The view controller that first instantiated the view controller is having the following code: @IBAction func

How to pass data from one View Controller to another in a Storyboard when going back?

…衆ロ難τιáo~ 提交于 2020-01-03 05:08:11
问题 Scenario: Storyboard with UINavigationController as initial controller. MainVC (navigation controller's root vc) needs the user to choose a location on a map. MainVC pushes a VC containing a MapKit map and adds itself as listener for a notification the MapVC sends out when the user chooses a location. MapKit is a memory hog, we all know that. iOS gives me a memory warning, I do all the things that need to be done, then iOS deallocates all it can deallocate, including the MainVC. MapVC sends

AppDelegate segue alternative pass data

为君一笑 提交于 2020-01-03 05:06:05
问题 I am struggling with passing data from my appDelegate to one of my view controllers. I have tried to use segues to do this, but this just doesn't work. So what I am wondering about is; is there any other way to present another view controller and pass data to it, other than using segues? Thanks in advance. 回答1: You can't use segue to ViewController from AppDelegate , because AppDelegate is not a ViewController . Segues are only work with ViewControllers . But you can initiate a storyboard

Unable to switch views programmatically using a storyboard?

空扰寡人 提交于 2020-01-03 04:56:08
问题 I am developing a storyboard-based application, using XCode 4.2. I'm new to storyboards, before that I used to switch views by creating a new instance of a class like this: if (x==1) { theClass *theView ; theView= [[theClass alloc] initWithNibName:nil bundle:nil]; [theView setText:theText]; [reader presentModalViewController:theClass animated:YES]; //where reader is an instance of the ZBar library } With storyboards, here is the code I am trying: if (x==1) { [self performSegueWithIdentifier:

Custom UITableViewCell delegate isn't calling a method

泄露秘密 提交于 2020-01-02 21:49:52
问题 I have two buttons in my custom-made UITableViewCell. Each button click should call the desired segue. I setup a delegate on a cell like this: CustomCell.h @protocol CustomCellDelegate -(void)seeQuestions; -(void)seeLessons; @end @interface CustomCell : UITableViewCell @property (weak, nonatomic) id <CustomCellDelegate> delegate; - (IBAction)seeQuestions:(UIButton *)sender; - (IBAction)seeLessons:(UIButton *)sender; CustomCell.m - (IBAction)seeQuestions:(UIButton *)sender { [self.delegate

SpriteKit: Passing variable from GameViewController to GameScene

时间秒杀一切 提交于 2020-01-02 16:18:53
问题 I created a menu in Storyboard that passes some information through a segue to GameViewController. Ideally, I could use that segue to pass the information directly to GameScene.swift where I need it, but I'm not sure that's an option since a scene is just a view and not a view controller. So, I pass the information to the GameViewController and that works great. But now, how to I get it to GameScene.swift? Segue from menu to GameViewController func passToGame(game: String) { performSegue