From bb5623c50c3cbad4f9526bf35fc49fbbca89eb06 Mon Sep 17 00:00:00 2001 From: Alan Maynard Date: Thu, 21 Mar 2019 12:54:54 -0400 Subject: [PATCH] SWF-11 Change context for segue - As a result of the change to modal presentation, the function we must override has changed - Instead of returning the context for the next interface controller, we return an array of contexts, each corresponding to the interface controllers in the order they appear in the navigation stack (Account details is first, transactions is now second) - once web service is set up, transactions should be passed to TransactionsInterfactController from this function --- .../AccountTableInterfaceController.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/AccountTableInterfaceController.swift b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/AccountTableInterfaceController.swift index ddbffd5..baa7b73 100644 --- a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/AccountTableInterfaceController.swift +++ b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/AccountTableInterfaceController.swift @@ -31,11 +31,12 @@ class AccountTableInterfaceController: WKInterfaceController { super.didDeactivate() } - //swiftlint:disable:next line_length - override func contextForSegue(withIdentifier segueIdentifier: String, in table: WKInterfaceTable, rowIndex: Int) -> Any? { + override func contextsForSegue(withIdentifier segueIdentifier: String, in table: WKInterfaceTable, rowIndex: Int) -> [Any]? { if segueIdentifier == "showAccountDetails" { + // account data is passed to the first interface controller in our new navigation stack + // if we want to pass to subsequent interface controllers, we would add them in corresponding order acctDict.updateValue(accounts[rowIndex], forKey: "acct") - return acctDict + return [acctDict] } return nil }