uistoryboardsegue

Preparing for segue in embedded tableView in Swift

落爺英雄遲暮 提交于 2019-12-08 05:47:43
问题 I have a UITableViewController with static cells embedded in a normal ViewController through a storyboard. This is al working as expected. However when I want to prepare for a segue when a cell on the embedded tableview is clicked the app crashes without a real error. I have a class for the embedded UITableViewController, TableViewVC, and a class in which it's embedded, RootVC. I want to implement the method: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?); I

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

牧云@^-^@ 提交于 2019-12-07 23:56:16
问题 Recently my app is crashing when the app switch to the next ViewController. this is the prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender ShowInfoViewController *secondViewController = (ShowInfoViewController *)segue.destinationViewController; this is how i call the method : [self performSegueWithIdentifier:@"infoseg" sender:self]; in the interface builder i have a segue with the same identifier as well. any idea? this is the log's Print : Terminating app due to uncaught exception

Conditional Segue from UITableView to DetailView based on object state

血红的双手。 提交于 2019-12-07 16:26:31
问题 I've set up the Xcode storyboard of my drill down table to branch out to two detail views. I want it to segue to either one based on the status of the Budget object that I tapped in the table view. If the budget object has not been initialized, I want to to segue to the initializing view. If it has been initialized, I want it to segue to the detail view. So far, this is what I have... - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { /* When a row is selected, the segue

How do I add a Back Button to the Navigation Bar through Storyboard?

≡放荡痞女 提交于 2019-12-07 12:46:15
问题 I'm very perplexed right now. Everywhere online I am seeing tutorials to add a custom back button, but I can't even seem to get the default one going. In my MainViewController, I have performSegueWithIdentifier(...) and then on the other end, I want the Navigation Bar to have the back button on the left. How does one achieve this? I can't seem to find any tutorials online. I've tried having a UINavigationController, and whenever I drag the "Navigation Item" in the storyboard up to the

PrepareForSegue from a UIButton in a custom prototype cell

痴心易碎 提交于 2019-12-07 11:54:07
问题 As the title say I have a tableView with prototype cell; cell is a custom cell (so I made a class called CustomCell.swift in witch I created the IBOutlet for image, label, button etc); here my class import UIKit class CustomCell: UITableViewCell { @IBOutlet var imageSquadra: UIImageView! @IBOutlet var button: UIButton! override func awakeFromNib() { super.awakeFromNib() // Initialization code } override func setSelected(selected: Bool, animated: Bool) { super.setSelected(selected, animated:

Difference between unwind segue and delegation

断了今生、忘了曾经 提交于 2019-12-07 07:05:49
问题 I wonder if anybody can explain the difference between using a unwind segue and using delegation in the example I have below: I have a FriendsTableViewController populated by an array of friends and another AddFriendTableViewController with a function to add a friend to the FriendsTableViewController . This is how I send the data from my AddFriendViewController with a unwind segue : #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation

Passing Data between view Controllers Using a segue from a view embedded in a navigation controller to a tabbarcontroller

我的梦境 提交于 2019-12-07 06:07:29
问题 I have two views that I would like to pass data from one view to the next. The first view is where I have the data that I would like to pass to the next view lets call it SourceViewController . However SourceViewController is embedded in a NavigationViewController and the secondViewController lets call it DestinationViewController is the firstView in a TabViewController . I have tried to use the answer from this question and it fails to go past navigation view it just skips the whole logic.

Preparing for segue in embedded tableView in Swift

蹲街弑〆低调 提交于 2019-12-07 03:07:25
I have a UITableViewController with static cells embedded in a normal ViewController through a storyboard. This is al working as expected. However when I want to prepare for a segue when a cell on the embedded tableview is clicked the app crashes without a real error. I have a class for the embedded UITableViewController, TableViewVC, and a class in which it's embedded, RootVC. I want to implement the method: override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?); I created the segue in my storyboard from a specific static cell in my TableViewVC. When I implement this

Conditional Destination View Controller from Sections in UITableView

与世无争的帅哥 提交于 2019-12-07 01:19:30
Code in TableView Controller if ([segue.identifier isEqualToString:@"showListFiles"]) { NSIndexPath *ip = [self.tableView indexPathForSelectedRow]; if (ip.section == 0) { NSDictionary *currentBill = [[_response objectForKey:@"facturas_pendientes"] objectAtIndex:ip.row]; DkBPaymentViewController *pvc = [[DkBPaymentViewController alloc] init]; pvc = (DkBPaymentViewController *) segue.destinationViewController; pvc.setUp = currentBill; } else if(ip.section == 1){ DkBBillsFileTableViewController *ftvc = segue.destinationViewController; ftvc.filesList = [[[_response objectForKey:@"facturas_pagadas"

Reference to the segue source view controller

别等时光非礼了梦想. 提交于 2019-12-06 23:15:44
问题 Within my viewDidLoad I would like some custom code based upon the previous controller. How can I access the segue source controller or the previous segue identifier in the destination controller's viewDidLoad to handle this? 回答1: There is no way to get a reference to the segue that created you. You could create a property (sourceVC in my example) in the destination controller, and assign self to this property in the prepareForSegue method (in the source view controller): [(DestinationVCClass