segue

Correct way of removing (deleting) a view/viewController from the stack after segue in Swift

本秂侑毒 提交于 2019-12-04 14:33:02
I am running into a problem here. I am presenting views with performSegueWithIdentifier . Everything goes smoothly. The problem is that as a test, I only have 2 viewControllers with some data in them and I have two buttons that call a segue back to the other VC. If I keep performingSegues, you can clearly see that the memory usage goes up every two segues by around 0.4Mb. This tells me that the Views are not being deleted/removed from the view stack and are just using memory. I would like to know the correct way of getting rid of the view that presents the other view by using

Show ViewController from XIB-file-Button - Swift

柔情痞子 提交于 2019-12-04 13:42:13
问题 is there a way how to segue from a xib-file (custom TableViewCell) to another ViewController in the Main.storyboard. There's no possibility to drag a segue, like within the main storyboard. In the cell I've got a button, from where I want to change the view. How can I solve it? Thanks! 回答1: You can always instantiate a view controller from your Storyboard and present it on button tapped: let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc = storyboard

how to apply condition based custom segue in storyboard

混江龙づ霸主 提交于 2019-12-04 13:22:06
问题 i am working on storyboards which has couple of views on first view a condition is placed i want if the condition satisfies then only navigation should happen For this i have used Custom segue but no matter my condition satisfies or not it navigates to new view. I have created method in custom segue class - (void) perform{ NSLog(@"source %@",self.sourceViewController); NSLog(@"dest %@",self.destinationViewController); UIViewController *sVC=self.sourceViewController; UIViewController *dVC=self

Swift: Creating a button that calls a method in another class1

北慕城南 提交于 2019-12-04 12:53:38
问题 I have 2 classes, the first class is named "store" where I create a button which calls a method: "storeSelected" located in the second class with the name ExploreViewController . The method should print "done" and take me to another view controller. Without the segue "done" is printed but when putting the segue code the app crashes. The error is: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<Glam.ExploreViewController: 0x14ed3be20>) has no segue

How to change speed of segue between ViewControllers

♀尐吖头ヾ 提交于 2019-12-04 12:12:40
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 . 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.view toView:dst.view duration:3.0 options:UIViewAnimationOptionTransitionFlipFromLeft completion:NULL]; }

Problems passing data to a DetailViewController from TableView in iOS5

最后都变了- 提交于 2019-12-04 11:33:42
I would appreciate any help in solving my problem that has had me pulling my hair out for the last day! Disclaimer 1 I'm an Objective-C noob - so the answer to this may be very simple (I'm coming from years of PHP). Please be nice. Disclaimer 2 Yes, I have extensively 'Googled' and looked at Apple Documentation - but have failed to come to an understanding of my problem. Summary I am trying to pass a value selected in a table view to another controller from a singleton. I am finding that the viewDidLoad method in the second view controller is completing before the tableView:

iOS - programmatic modal segue with animation (such as flip)

微笑、不失礼 提交于 2019-12-04 11:01:39
I know I can do a modal segue in code like this: [presentModalViewController:my_view, animated:YES]; but how do I specify a fade in or horizontal/vertical flip programmatically? Thanks, Pachun set this property to your viewController: modalTransitionStyle UIModalTransitionStyle from apple doc typedef enum { UIModalTransitionStyleCoverVertical = 0, UIModalTransitionStyleFlipHorizontal, UIModalTransitionStyleCrossDissolve, UIModalTransitionStylePartialCurl,} UIModalTransitionStyle; 来源: https://stackoverflow.com/questions/10901006/ios-programmatic-modal-segue-with-animation-such-as-flip

storyboard segue from a tablecell an its Detail Disclosure Button

喜欢而已 提交于 2019-12-04 09:51:18
I want to segue from a tablecell to two different viewcontrollers if clicked in the cell or clicked on the cells Detail Disclosure Button. If I ctrl-drag the second segue, the first is deleted. What am I doing wrong? Tnx Mica I don't think you can link a specific detail disclosure button w/ a segue. My storyboards are extremely programatic b/c I use alot of custom CGRect etc.. so I tend to use something like this: -(void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { [self performSegueWithIdentifier:@"ViewControllerIdentifer" sender:self]

prepareForSegue and PerformSegueWithIdentifier sender

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 08:11:30
问题 I am wondering about how the functions in the title work and also about the sender parameter. Lets say a button click calls the performSegue method, does that also call the prepareSegue method as well? Is the prepareSegue method called before the performSegue method but after the button is pressed? Also, is the "sender" parameter in both of the functions linked? If I pass in a string as the sender in the performSegue method, will that transfer over to the sender parameter in the prepareSegue

ContainerView with multiple embed segues

我们两清 提交于 2019-12-04 07:41:13
问题 Is there a way to have a single ContainerView with multiple embed segues? The aim is for a ContainerView to hold a few different ViewControllers depending on what buttons have been pressed; only one is going to be visible at a time. I want to use embed segues so that in Interface Builder the storyboards are automatically shown at the same size as the ContainerView. I realise that I can manually resize the other ViewControllers in InterfaceBuilder, but I want the automatic sizing provided by