segue

How to know the sender's identifier in Swift

谁说我不能喝 提交于 2019-12-12 02:53:54
问题 I have two UILabels with two UITapGestureRecognizers in a UITableViewCell . cell.Username.tag = indexPath.row cell.SharedUser.tag = indexPath.row let tapGestureRecognizer2 = UITapGestureRecognizer(target:self, action:"GoToProfil:") let tapGestureRecognizer3 = UITapGestureRecognizer(target:self, action:"GoToProfil:") cell.Username.userInteractionEnabled = true cell.Username.addGestureRecognizer(tapGestureRecognizer2) cell.SharedUser.userInteractionEnabled = true cell.SharedUser

Simple segue not working in xcode 7

孤街浪徒 提交于 2019-12-12 02:49:02
问题 Simple segue that has worked for months performed with this command: [self performSegueWithIdentifier:@"ExpirationWarningSegue" sender:self]; now yields this error: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not perform segue with identifier 'ExpirationWarningSegue'. A segue must either have a performHandler or it must override -perform.' What? It's a segue. I command-drag from one UIViewController to another in the storyboard. I'm not

Tap button in tableview - wrong cell

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 02:39:30
问题 Hi I am trying to pass a variable in the cell which is the label when i click on a button in the cell. but the problem is every when I put the code in cellForRowAtIndexPath, it gets the label from the wrong cell every time. why and how to fix this? var variableToPass: String! func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell : MainCell! = tableView.dequeueReusableCellWithIdentifier("MainCell") as! MainCell variableToPass =

Receiver (<ViewController:>) has no segue with identifier 'showAlerting''

我怕爱的太早我们不能终老 提交于 2019-12-12 02:35:20
问题 The segue runs but the app crashes with the above error. Why do I get this no segue with identifier message? I defined the segue Identifier. Here is the viewDidAppear method - (void)viewDidAppear:(BOOL)animated { [self performSegueWithIdentifier:@"showAlerting" sender:self]; } - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"showAlerting"]) { NSLog(@"Logging showAlerting"); } } I got these log messages 2015-03-28 20:04:33.025

DismissViewControlers when Multiple ViewControllers/segues are present

随声附和 提交于 2019-12-12 01:57:48
问题 I have the following scenario with three ViewController's There is a button in VC2. User Already Logged-in Case : Clicking on this button in VC2 will take you to VC3 , i.e I have a push-segue from VC2 to VC3 User Not Already Logged-in Case: Clicking on the button , will take you to LoginVC(modal segue) ,On successfull-login ,User will go to VC3((modal segue) and then the user can go back to VC2 on clicking back button. i.e, VC2 will present LoginVC , LoginVC will present VC3. Question-1 : How

prepareForSegue passes value for Index 0…ALWAYS

拟墨画扇 提交于 2019-12-12 01:54:48
问题 I have an array of items displayed in a TableViewController . They display properly in the TVC. The code below segues, but it only segues to indexPath 0 of my array of MKMapItem s, not the item from the cell that was clicked. Any thoughts on where my mistake is? @property (strong, nonatomic) NSArray *mapItems; Each cell has a "Add POI" UIButton which that triggers a segue created with Interface Builder called "addPOISegue". Here's the IBAction for the "Add POI" button: - (IBAction

How to pass indexPath from segue to destination view?

蹲街弑〆低调 提交于 2019-12-12 01:49:58
问题 I have two buttons in a custom layout collectionView's footer. I want to pass the indexPath of the footerView to destinationView class when user taps the button. I wrote my code in a typical way which I succeeded before. However, in some reason, whenever I tap the button it crashes. I tried different approaches for each button to accomplish this job but neither worked. I have set destinationView's class to the right class in a storyboard. Please somebody help me. Any help with code example

segue with correct identifier can not work

不羁的心 提交于 2019-12-12 01:46:01
问题 I've search almost every related question, but still can not find a clue... Here is what I did: 1.Create a scrollView using storyboard. 2.Programticaly created 10 myController(which are UITableViewControllers) inside the scrollViewController, So I can use panGesture to switch between tables. and it's working fine. 3.Created a tableViewController using storyboard, set myController to be the corresponding view controller. 4.Embedded the tableViewController in navigation controller. 5.Control

Performing segue after dismissing modal swift

人走茶凉 提交于 2019-12-12 01:29:02
问题 So I'm pushing a side menu onto my root menu using a modal segue and then attempting to dismiss the side menu that only covers half the page and performing the segue from the root vc when a button is pressed in the side menu. It either returns; recivere has no sague with identifier, or warning: attempt to perform segue that is not in window hierarchy. func SubmitSettingPressed (sender: UIButton){ let mainView = MainViewController() dismiss(animated: true) { let vc = storyboard?

How to call performSegueWithIdentifier from xib?

家住魔仙堡 提交于 2019-12-12 01:28:48
问题 I have viewController with segue to secondViewController named "toSecond". In viewController i load customView.xib let myCustomView = NSBundle.mainBundle().loadNibNamed("customView", owner: self, options: nil)[0] in this customView i have button with action: viewController().goToSecond() in viewController i have function with this code func goToSecond() { self.performSegueWithIdentifier("toSecond", sender: self) } but when i pressed button in customView i become a error: viewController has no