segue

Passing values between ViewControllers based on list selection in Swift

爱⌒轻易说出口 提交于 2019-12-12 17:24:30
问题 I'm trying to pass the selected index number of a listView selection from one ViewController to another but am running into an issue with the tableView didSelectRowAtIndexPath delegate runs slightly later than the prepareForSegue function. Basically, in didSelectRowAtIndexPath, I seta variable, which is then picked up in the prepareForSegue. The issue is that prepareForSegue seems to run the second that the cell is selected and before the didSelectRowAtIndexPath function is called so my

Perform Segue from Collection View Cell

牧云@^-^@ 提交于 2019-12-12 16:50:54
问题 import UIKit class ActionCollectionViewCell: UICollectionViewCell { @IBOutlet weak var myLabel: UILabel! @IBOutlet weak var actionGIF: UIImageView! @IBAction func actionPressed(sender: AnyObject) { print(myLabel.text) Global.actionButtonIndex = myLabel.text!.toInt()! - 1 print(actionGIF.image) ActionViewController.performSegueWithIdentifier("showActionPreview", sender: nil) } } I am trying to perform a Segue after User Clicking on One of the Cell in my Collection View. Can't seem to do that

Objective C IOS prepareForSegue how do I get an int variable I assigned to a button to next View controller

試著忘記壹切 提交于 2019-12-12 16:37:51
问题 So I have a collection view which generates a set of buttons dynamically using core data. I have completed that part where I have assigned buttons and values to the buttons. - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { static NSString *identifier = @"Cell"; [self.collectionView registerNib:[UINib nibWithNibName:@"CollectionViewCell" bundle:nil] forCellWithReuseIdentifier:identifier]; CollectionViewCell *cell =

“Present as Popover” segues and view size

强颜欢笑 提交于 2019-12-12 11:29:50
问题 Can anyone point to any guidance/documentation on how items should be placed in a view controller that will be displayed as a popover so that the components are appropriately positioned with auto layout? Specifically: I'm working in Xcode 8.3 with the new "Present as Popover" segue, with the new "universal" storyboards. I add a view controller and then a popover segue to that view controller. When it is displayed, I see that roughly the top-left quadrant of the view controller is displayed as

Dismissviewcontroller and perform segue

泄露秘密 提交于 2019-12-12 11:22:33
问题 I need to go to another viewcontroller with performSegueWithIdentifier but I also need to remove the viewcontroller I'm currently in. How can I do this, I have tried this but it doesn't work: [self performSegueWithIdentifier:@"next" sender:self]; [self dismissViewControllerAnimated:NO completion:nil]; //tried the other way, but it doesn't work either [self dismissViewControllerAnimated:NO completion:nil]; [self performSegueWithIdentifier:@"next" sender:self]; It looks like there isn't any

Unwind Segue from Modal/Popover resulting in Unbalanced calls to begin/end appearance transitions

戏子无情 提交于 2019-12-12 10:38:58
问题 I have the following setup: Nav Controller -> VC1 -Push--> VC2 -PopOver or Modal Segue--> VC3. VC3 is unwinding back to VC1. When the Segue from VC2 to VC3 is PopOver and Modal, the unwind ends in a warning: Unbalanced calls to begin/end appearance transitions for UIViewController" If the Segue from VC to VC is push, the warning is gone. Any idea how to get rid of the warning or why its even showing? 回答1: It's a bug. Ignore it (or, if you want to be a good citizen, file a bug report with

Can I use segues with designated initializers of view controllers?

旧街凉风 提交于 2019-12-12 10:32:57
问题 I am new to storyboards and I have set up a segue from a button to a view controller. This view controller is of a custom subclass SFListViewController , which has a designated initializer initWithList: . Using the designated initializer is the only way to correctly initialize the view controller. However, when using segues the designated initializer won't be called (obviously). - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"Show

Perform segue from button in XIB

梦想与她 提交于 2019-12-12 10:02:52
问题 I'm using storyboards for the most of my project, but i have one UIScrollView that consists of multiple views that are loaded from XIB I'm stuck on how to perform a segue when a button is clicked in the XIB What i've done already. Added the views to a scroll view Added a custom button added an IBAcion on the custom button MainViewController NSString *nibName = @"coverArticleView"; NSArray *nibObjects = [NSBundle.mainBundle loadNibNamed:nibName owner:self options:nil]; coverArticle *pageView =

How to change speed of segue between ViewControllers

╄→尐↘猪︶ㄣ 提交于 2019-12-12 08:57:00
问题 Is it possible to control segue speed? I have checked the documentation but there is no given method by Apple. But I am more looking for ideas to hack in and change lower level code to make segueing in slow motion . 回答1: Below code is of custom segue, and you can set duration of transition in code. - (void)perform { UIViewController *src = (UIViewController *) self.sourceViewController; UIViewController *dst = (UIViewController *) self.destinationViewController; [UIView transitionFromView:src

Unwind segue function with Back button

北城余情 提交于 2019-12-12 07:46:20
问题 I'm trying to call function when i'm pressing default Back button (e.g. < Settings ) in Navigation Controller. At other situations i'm creating custom button, after i'm Ctrl+Dragging to red Exit button in XCode and pointing it to Selection segue. Now i need to use default back button of navigation controller, but i can't set assign it to segue action because it's no back button in Storyboard view (but it exists in Simulator). Simulator: XCode: I can create custom button in navigation