segue

pass data from tableviewcontroller to another tableviewcontroller in swift

南楼画角 提交于 2019-12-08 02:46:34
问题 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

popToViewController is not working “Tried to pop to a view controller that doesn't exist”

风流意气都作罢 提交于 2019-12-08 00:27:34
问题 I am trying to use popToViewController and it I keep getting the error "Tried to pop to a view controller that doesn't exist"? I am in a Settings view and when the user clicks "Sign Out" I dismiss the Settings VC and segue back to the mainView where an unwind segue method is called. In the unwind segue method I call the following. -(IBAction)endSettingsViaLogout:(UIStoryboardSegue *)segue { //[self performSegueWithIdentifier:@"mainToLoginSegue" sender:self]; [self.navigationController

Could not cast value of type 'UITableViewController' to 'UINavigationController'

試著忘記壹切 提交于 2019-12-07 19:54:49
问题 I'm trying to segue from one view controller to another, and pass data to the next controller. But I keep getting this error: Could not cast value of type 'UITableViewController' to 'UINavigationController' override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) { if (segue.identifier == "segueLogWaterData") { // pass data to next view let nav = segue.destinationViewController as! UINavigationController let segueViewController = nav.topViewController as!

Perform a Segue Called by a UITableViewCell

做~自己de王妃 提交于 2019-12-07 16:40:47
问题 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

Custom UITableViewCell delegate isn't calling a method

家住魔仙堡 提交于 2019-12-07 13:04:30
I have two buttons in my custom-made UITableViewCell. Each button click should call the desired segue. I setup a delegate on a cell like this: CustomCell.h @protocol CustomCellDelegate -(void)seeQuestions; -(void)seeLessons; @end @interface CustomCell : UITableViewCell @property (weak, nonatomic) id <CustomCellDelegate> delegate; - (IBAction)seeQuestions:(UIButton *)sender; - (IBAction)seeLessons:(UIButton *)sender; CustomCell.m - (IBAction)seeQuestions:(UIButton *)sender { [self.delegate seeQuestions]; } - (IBAction)seeLessons:(UIButton *)sender { [self.delegate seeLessons]; } Now, in the

Segue from UITableViewCell by tapping on an image inside of cell

一个人想着一个人 提交于 2019-12-07 12:13:12
问题 Been trying to figure this out for a while now and after a couple hours of searching for a solution I decided it was time to ask. I have a tableview that gets populated by custom UITableViewCells and currently when you tap on a cell it takes you to a detail view. Within the custom cell there is an image, I would like the user to be able to tap on that image and segue to a popover VC that shows the image. What I'm having trouble with is creating the segue when the image is tapped. In the file

How to hide the back button from the status bar on the Apple Watch?

你离开我真会死。 提交于 2019-12-07 11:59:08
问题 I want to hide the back button from my Apple Watch app from the status bar. I used the programmable segue to navigate. But I want to to hide/disable the back button. Is it possible? 回答1: This is how you do it: WKInterfaceController.reloadRootControllersWithNames( ["myInterfaceController"], contexts: [] ) Where myInterfaceController is the identifier of the destination Interface Controller. Thanks to Harvant for the pointer. 回答2: If you check the docs for WKInterfaceController , you'll see

How can I auto segue when a timer finishes?

放肆的年华 提交于 2019-12-07 10:08:54
问题 I want to auto segue when a timer runs out. I have a timer constructed here: class Timer{ var timer = NSTimer(); // the callback to be invoked everytime the timer 'ticks' var handler: (Int) -> (); //the total duration in seconds for which the timer should run to be set by the caller let duration: Int; //the amount of time in seconds elapsed so far var elapsedTime: Int = 0; var targetController = WaitingRoomController.self /** :param: an integer duration specifying the total time in seconds

How to set imageView image on prepareForSegue iOS?

我只是一个虾纸丫 提交于 2019-12-07 08:24:25
I tried to push to a ViewController using prepareForSegue . When I'm pushing, I want to set an image on ImageView in pushed view controller. Here what I tried, ViewController -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ UIButton *btn = sender; if (btn.tag == 50) { if (jpegData) { [self saveTempImage:jpegData]; } if ([segue.identifier isEqualToString:@"HomeView"]) { HomeViewController *vc = [segue destinationViewController]; vc.backImageView.image = capturedImage; vc.isBackImage = true; } } } I have an ImageView in HomeViewController . I tried to set it's image using

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.