segue

Why can't I use the show segue in xcode 6.1?

淺唱寂寞╮ 提交于 2019-12-01 17:51:22
问题 So I was doing a test for another swift project and I wanted to connect a TableViewController that had a NavigationController embedded in to a regular ViewController using a segue between a bar button item and the second ViewController . When I control-drag the button to the ViewController , I only get the following options: From what I understand, I should see a long list of items including show and show detail. Even if I connect them with push or any other segue, I can't select show or show

Why can't I use the show segue in xcode 6.1?

二次信任 提交于 2019-12-01 17:45:23
So I was doing a test for another swift project and I wanted to connect a TableViewController that had a NavigationController embedded in to a regular ViewController using a segue between a bar button item and the second ViewController . When I control-drag the button to the ViewController , I only get the following options: From what I understand, I should see a long list of items including show and show detail. Even if I connect them with push or any other segue, I can't select show or show detail as the type of segue if I select the segue. What am I doing wrong? I have not made

Unwind Segue in Xcode 6 Beta 4

你离开我真会死。 提交于 2019-12-01 16:20:33
I've been trying to add an unwind segue to a swift app in Xcode 6, and, in the release notes for the first three betas, it was declared to be unsupported. However, in Beta 4, that bug note is no longer present. I have heard that people have been able to get it to work, but I have had no such luck. So, my question is this: how should I try to see if the unwind segue will work in my app? What should I try? I am using a UIBarButtonItem to trigger the segue. So far, I've put this code in the destination controller's .swift file: @IBAction func unwindToSegue(segue:UIStoryboardSegue) {} Using this

In swift, how can I wait until a server response is received before I proceed?

别等时光非礼了梦想. 提交于 2019-12-01 14:51:16
I would like to only execute a segue if I get a certain response from the server. In swift, how can I wait until I get a response to continue? Bottom line, you don't "wait" for the response, but rather simply specify what you want to happen when the response comes in. For example, if you want to perform a segue when some network request is done, you should employ the completion handler pattern. The issue here is that you're probably accustomed to just hooking your UI control to a segue in Interface Builder. In our case, we don't want to do that, but rather we want to perform the network

Bi-directional storyboard travel without stacking

浪尽此生 提交于 2019-12-01 14:46:31
Push segues stack view controllers, while popping 'unstacks' them. Modal segues stack view controllers, while unwinding 'unstacks' them. I am trying to create a custom segue to move between VCs in a linear (flat) hierarchy, in either direction, without stacking in either direction. It would appear that having segues in both directions between VCs prevents dismissal. Any ideas? If you don't want any sort of stack, just have your perform method replace the window's root view controller with the destination view controller. The source view controller will then be deallocated (as long as you didn

In swift, how can I wait until a server response is received before I proceed?

女生的网名这么多〃 提交于 2019-12-01 13:32:43
问题 I would like to only execute a segue if I get a certain response from the server. In swift, how can I wait until I get a response to continue? 回答1: Bottom line, you don't "wait" for the response, but rather simply specify what you want to happen when the response comes in. For example, if you want to perform a segue when some network request is done, you should employ the completion handler pattern. The issue here is that you're probably accustomed to just hooking your UI control to a segue

how can I pass data from one container to another, both embedded in the same uiviewcontroller in swift?

烂漫一生 提交于 2019-12-01 13:24:47
I have a parent UIViewController and it has two different view containers - each of them has embedded UIViewController inside. It looks somehow like this: I want to change the label on the right container when user presses the button stored on the left one. So far I was able to do it while having a button placed in a parent view controller, then I was just using a protocol: in my parent component I had: class ParentController: UIViewController { var delegateEmbedded:HandleEmbedded? override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if (segue.identifier ==

Performing segue from another class

喜你入骨 提交于 2019-12-01 13:22:08
I am trying to call performSegueWithIdentifier from different class which is NSObject class and I am receiving this error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<DerinlikView: 0x95b1ac0>) has no segue with identifier 'DerinlikToPali'' My code is: Class1 (NSObject): DerinlikView *derinlik = [DerinlikView alloc]; [derinlik performSegue]; Class2 (UIViewController): - (void) performSegue { [self performSegueWithIdentifier:@"DerinlikToPali" sender:self]; } - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ( [[segue

Adding button programmatically to perform segue

喜夏-厌秋 提交于 2019-12-01 13:12:41
I am trying to create a button 'on the fly' using code, and i want that button to perform segue to a different controller. As far as i know, creating segue programmatically is not possible, but how can i get pass that if the created button is not on my storyboard? This is the code for creating the button: - (void)addButton:(UIView*)view inLocation:(CGPoint)point { UIButton *but=[UIButton buttonWithType:UIButtonTypeRoundedRect]; but.frame= CGRectMake(point.x, point.y,30,30); [but setTitle:@"CHOOSE" forState:UIControlStateNormal]; // The nilSymbol should call a method that will perform the segue

Bi-directional storyboard travel without stacking

百般思念 提交于 2019-12-01 12:11:42
问题 Push segues stack view controllers, while popping 'unstacks' them. Modal segues stack view controllers, while unwinding 'unstacks' them. I am trying to create a custom segue to move between VCs in a linear (flat) hierarchy, in either direction, without stacking in either direction. It would appear that having segues in both directions between VCs prevents dismissal. Any ideas? 回答1: If you don't want any sort of stack, just have your perform method replace the window's root view controller