segue

How to create a segue from the disclosure indicator on a table view to another viewController?

谁都会走 提交于 2020-01-15 04:14:08
问题 Is it possible to do that? It appears impossible to drag from the disclosure indicator on a tableViewCell prototype to a viewController to create a segue. How can I do that? 回答1: control + click on disclosure indicator connect to viewController you will get a menu like this select the accessory action 来源: https://stackoverflow.com/questions/26011945/how-to-create-a-segue-from-the-disclosure-indicator-on-a-table-view-to-another-v

Segue call from viewDidAppear works, but not from viewWillAppear

妖精的绣舞 提交于 2020-01-14 09:36:06
问题 I have the following scenario with the given environment: Xcode v7.3.1 Swift 2 From within a login viewController, I initially had the following segue call in viewWillAppear method to bypass login screen if the user is already logged in: override func viewWillAppear(animated: Bool) { if PFUser.currentUser() != nil { self.performSegueWithIdentifier("login", sender: self) } } The segue was not working, so I set a breakpoint where the segue call is being made and verified that it is indeed being

Swift 4: prepare(for segue:) being called after viewDidLoad

喜你入骨 提交于 2020-01-13 10:37:29
问题 I have 2 VCs: CouponVC and CouponFeedbackVC . Coupon VC receives brand: Brand! from its parentViewController. Now I want to pass the brand.name to CouponFeedbackVC . CouponVC.swift var brandName: String! override func viewDidLoad() { super.viewDidLoad brandName = brand.name } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "couponToFeedBack" { if let vc = segue.destination as? CouponFeedbackVC { print(brandName) vc.brandName = self.brandName } } } In

Perform segue on press on Back button

浪尽此生 提交于 2020-01-13 06:16:47
问题 I want to perform segue when I click on Back button. For it I do: override func didMoveToParentViewController(parent: UIViewController?) { self.performSegueWithIdentifier("fromGalleryToBody", sender: self) } but it crashes my app when I tap on Back button. How can I realize it? 回答1: Default button of navigation gives you functionality to move to the previous view You can check it by : override func didMoveToParentViewController(parent: UIViewController?) { if parent == nil { println("Back

Perform segue on press on Back button

你。 提交于 2020-01-13 06:16:10
问题 I want to perform segue when I click on Back button. For it I do: override func didMoveToParentViewController(parent: UIViewController?) { self.performSegueWithIdentifier("fromGalleryToBody", sender: self) } but it crashes my app when I tap on Back button. How can I realize it? 回答1: Default button of navigation gives you functionality to move to the previous view You can check it by : override func didMoveToParentViewController(parent: UIViewController?) { if parent == nil { println("Back

Cant call a segue in code (Swift)

ぐ巨炮叔叔 提交于 2020-01-12 15:00:36
问题 I have a few views embedded in a navigation controller. I've created a few segues (some from buttons to other view controllers, some from one view controller to another one. for example I have a segue (Show) from one button to a view controller called name2, when I press the button it works great, but when I try to call it programmatically the app crashes and gives an error. This is how I call the segue on ViewController1 self.performSegueWithIdentifier("name2", sender: self) this is from

Custom unwind segue animation

喜欢而已 提交于 2020-01-11 19:58:08
问题 I have the following set up: The red controller has a method - (IBAction)unwindToRed:(UISegue *)segue and a - (UIStoryboardSegue *)segueForUnwindingToViewController:(UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController identifier:(NSString *)identifier which returns a custom segue for this event. In my custom segue I have the following in the perform code: - (void)perform { // Just helpers to get the controllers from the segue UIViewController

Custom unwind segue animation

眉间皱痕 提交于 2020-01-11 19:57:50
问题 I have the following set up: The red controller has a method - (IBAction)unwindToRed:(UISegue *)segue and a - (UIStoryboardSegue *)segueForUnwindingToViewController:(UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController identifier:(NSString *)identifier which returns a custom segue for this event. In my custom segue I have the following in the perform code: - (void)perform { // Just helpers to get the controllers from the segue UIViewController

Swift link Image from Parse array using segues to secondViewController

爱⌒轻易说出口 提交于 2020-01-11 11:59:11
问题 Here is my code, i am trying to use the "prepareForSegue" function to send an image from tableViewController (firstViewController) to my detailedViewController (secondViewController). I have managed to populate my firstViewController from the parse cloud successfully and I have managed to get my secondViewController Labels to update, but i can not get the imageView to update. I have posted my code below firstViewController override func prepareForSegue(segue: UIStoryboardSegue, sender:

Passing Data between interface controllers in WatchKit

 ̄綄美尐妖づ 提交于 2020-01-10 18:58:15
问题 How would I pass data stored in a label from my Interface Controller to another interface controller in WatchKit using Swift? I can't seem to find an answer anywhere, hope someone here can help me. I've included the section of my code that deals with calculating the value I need passed. I basically want to show the same value that was calculated by the user and elaborate more on it in the next Interface Controller named ResultsController. Any help is greatly appreciated :D class