segue

Pass data through unwind segue

痴心易碎 提交于 2020-01-24 01:27:07
问题 I have been looking all over for an answer for this...I do not know how to pass data through an unwind segue. I know I am supposed to use prepareForSegue but I am not sure what I am supposed to put in. I am trying to pass a variable (myLabel) from a UIPickerView in one class: func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { myLabel.text = pickerData[row] } to another class. I have the unwind segue code already but do not know where to put the

Dismiss modal, then immediately push view controller

心不动则不痛 提交于 2020-01-23 17:17:29
问题 How can I dismiss a modal and then immediately push another view? I am adding this code in a didSelectRowAtIndexPath: UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; ChatTableViewController *chatVC = (ChatTableViewController*)[storyboard instantiateViewControllerWithIdentifier:@"chatVC"]; [self dismissViewControllerAnimated:YES completion:^{ [[self navigationController] pushViewController:chatVC animated:YES]; }]; The modal view dismisses, but nothing happens

Conditionally skipping a UIViewController in an iOS 5 app with UINavigatonController

半腔热情 提交于 2020-01-23 05:05:05
问题 In our iOS application with three UIViewController s one after another, we would like to skip the middle one based on some condition and go directly from first to third. However, the user should be able to come back to the second one via the "Back" button on the third controller. I tried [self performSegueWithIdentifier:@"segueId" sender:sender]; from viewDidLoad , viewWillAppear but this corrupts the navigation bar as indicated by the debug log. Calling this code from viewDidAppear works

Xcode - Passing datas between 2 views by dismissViewControllerAnimated

。_饼干妹妹 提交于 2020-01-17 19:06:57
问题 I have used dimissViewControllerAnimated to return the view from Spring Insert Variables back to Spring Element . At the same time, my input datas should be passed from Spring Insert Variables back to Sprint Element by the function unwindSecondView in Spring Element class. But apparently the datas are not pass, my arrays: force and stiffness still do not contain value. Can anyone advice on this? Code From Spring Insert Variables class class springInsertVariables : UIViewController { var

Segueing to another view controller without displaying the first in iOS 8

ぃ、小莉子 提交于 2020-01-17 01:39:45
问题 I am trying to understand the new segues in iOS 8. I have an app with a typical login screen shown initially, and if the user is logged in, that screen should not display (even for a split second) and user should be on a feed screen, which I am segueing from the initial login screen. However, I am not able to do what I want. First of all, I can only use Present Modally segue, as it's the only appropriate segue that allows removing animation. Depending where I try to segue in view controller

Performing Segue from AppDelegate.swift

情到浓时终转凉″ 提交于 2020-01-16 05:38:14
问题 I am trying to perform a segue after getting a notification. Here is what I have in my app delegate. func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) { let viewController = self.window!.rootViewController!.storyboard!.instantiateViewControllerWithIdentifier("SecondViewController") self.window?.rootViewController = viewController } This takes me directly to the view I would like it to go to, however the navbar and tab bar are hidden.

ios automatically segue from one screen to another

旧时模样 提交于 2020-01-16 01:15:14
问题 So I have learnt how to segue from one screen to another when user presses a button. This is all handled in StoryBoard by literally pointing the button to the next screen. However I would like to have a page that will automatically segue to another page after some data has been downloaded (so no user interaction). What method call do I need to call from my ViewController class so that it calls the segue to be performed ? Thanks 回答1: create a segue from firstviewcontroller (data download view

NSInvalidArgumentException after manually triggering seque

主宰稳场 提交于 2020-01-15 23:01:26
问题 I'm in the "awesome" position to have to support someone else's code even though before this project I have never worked in objective C or made iOS apps, so please excuse me if I'm doing something really obvious or stupid. I needed a new view controller with a custom class. First I drew the view on my storyboard. Then I created a new class which I derived off of UIViewController. Then, I set the view's custom class to this new class I made. I hooked up the single button on the view to the

NSInvalidArgumentException after manually triggering seque

青春壹個敷衍的年華 提交于 2020-01-15 23:01:10
问题 I'm in the "awesome" position to have to support someone else's code even though before this project I have never worked in objective C or made iOS apps, so please excuse me if I'm doing something really obvious or stupid. I needed a new view controller with a custom class. First I drew the view on my storyboard. Then I created a new class which I derived off of UIViewController. Then, I set the view's custom class to this new class I made. I hooked up the single button on the view to the

How to create a segue from the disclosure indicator on a table view to another viewController?

£可爱£侵袭症+ 提交于 2020-01-15 04:14:26
问题 Is it possible to do that? It appears impossible to drag from the disclosure indicator on a tableViewCell prototype to a viewController to create a segue. How can I do that? 回答1: control + click on disclosure indicator connect to viewController you will get a menu like this select the accessory action 来源: https://stackoverflow.com/questions/26011945/how-to-create-a-segue-from-the-disclosure-indicator-on-a-table-view-to-another-v