segue

pass data from tableviewcontroller to another tableviewcontroller in swift

£可爱£侵袭症+ 提交于 2019-12-06 06:19:10
I have a form I am creating this form gets filled with textfields the user inputs. After answering all the questions a button pops up to save. I am having a problem making this tableviewcontroller to pass the data to a new tableviewcontroller. I'm stuck and not sure how to go about this. import UIKit class TableViewController: UITableViewController, UITextFieldDelegate { @IBOutlet weak var saveBtn: UIButton! @IBOutlet var firstNameField: UITextField! @IBOutlet var middleNameField: UITextField! @IBOutlet weak var lastNameField: UITextField! @IBOutlet weak var addressField: UITextField!

Segue in swift based on a logic

萝らか妹 提交于 2019-12-06 04:18:22
I want show a one of the two views in swift based on a if statement when the application first launches how do I do that this is the logic if signupconfirmed == true { // have to show one view } else { // have to show another view } One way is you can initiate viewController with identifier with below code: var signupconfirmed = true @IBAction func signUpPressed(sender: AnyObject) { if signupconfirmed { // have to show one view let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc = storyboard.instantiateViewControllerWithIdentifier("First") as! SViewController self

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

会有一股神秘感。 提交于 2019-12-06 04:13:06
问题 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 回答1: set this property to your viewController: modalTransitionStyle UIModalTransitionStyle from apple doc typedef enum { UIModalTransitionStyleCoverVertical = 0, UIModalTransitionStyleFlipHorizontal, UIModalTransitionStyleCrossDissolve, UIModalTransitionStylePartialCurl,} UIModalTransitionStyle; 来源:

UISplitViewController - Multiple Detail View Controllers via storyboard segues

≯℡__Kan透↙ 提交于 2019-12-06 02:26:33
问题 I'm trying to do a project for the iPad in which I'd like to utilized the split view controller. I'll be having different detail view controllers for each of the cells in the master view controller. I saw one solution how to do this via storyboard segues in this site. He basically linked each of his UITableViewCell to different detail view controllers. But I'd like to know if this is a "stable" or a "good" way of doing this. I mean, is it any better or as stable as doing it programmatically?

How to pass data from one view controller to the other SWIFT

旧时模样 提交于 2019-12-06 01:45:31
I am making an app where a table view with a search bar and scope bar has to segue to a detail view controller and that detail view controller has to display data based on which cell is selected. I have an array with structs set up to sort and search for the items. I need to keep this feature, I have another swift class for my detail view controller that I will put if/else statements into that deal with displaying the data based on what cell I select. What I need to know how to do is attach a variable to the cells and pass that variable to the detail view controller to use in my if/else

Invoking push segue programmatically and prepareforsegue method

风流意气都作罢 提交于 2019-12-06 01:04:28
问题 I'm invoking push segue programmatically as below UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; UIViewController *vc = [mainStoryBoard instantiateViewControllerWithIdentifier:@"addToCartViewContollerForItem"]; [self.navigationController pushViewController: vc animated:YES]; but my problem is I want to send some info with this segue to the destination viewcontroller. But the method - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender is

The label “Cancel” from modal segue in Apple Watch showing wrong text - “abbrechen”

China☆狼群 提交于 2019-12-06 00:07:36
问题 When my WKInterfaceController poped up by pressing a menuItem (which was settup by " self.addMenuItem in mainScreen"), the title on the poped WKInterfaceController shows " abbrechen " instead of " Cancel ". Anyone know how to fix it to make it showing " Cancel "? Or like where did I probably make a mistake? //MainScreen.swift func setContextItems(directToEnabled: Bool) { self.clearAllMenuItems() self.addMenuItem(with: WKMenuItemIcon.decline, title: "direct", action: #selector(MainScreen

Perform a Segue Called by a UITableViewCell

故事扮演 提交于 2019-12-05 21:15:48
I have some UIButtons in a custom table view cell that when pressed I want them to call segues in the view controller that is host to the table view that the cells are in. What I am doing now is declaring an action like this: - (void)action; in the class that the table view is in. And then I am calling that action from the cell like this: ViewController *viewController = [[ViewController alloc] init]; [viewController action]; However when the action is called it says that there is no such segue for the view controller which I know to be incorrect. Calling "action" from the view controller

Push View Controllers from Modal View in Storyboard

本小妞迷上赌 提交于 2019-12-05 19:10:35
I am using storyboard and have a screen which is presented modally, which I then need to push other view controllers from so that I can select items for the modal view (similar to adding an entry on the iPhone Calendar app). So I am going from: Navigation Controller > VC > Modal View Controller > ??? Here I want to push a VC so that I can select an item to return to the modal view. How can I make this possible as I'm currently getting an error "Push segues can only be used when the source controller is managed by an instance of UINavigationController." Ah ok, so I now have it setup like you

How to perform Segue in AppDelegate?

你。 提交于 2019-12-05 18:26:53
问题 I am trying to complete an application on IOS 5.1 with Storyboard. Basically I am doing a dropbox app. Since I am using Dropbox SDK link to Dropbox is handled in AppDelegate.m. User has the option of be able to unlink from a session and link again in different View Controllers. So every time user link and unlinked app has to switch view from Appdelegate to a view controller that is unconnected to rootviewcontroller In original Dropbox's example Dropbox handled transition like following code -