From b8d1b8112d6fac4c3c341e79d812bf5047467e2a Mon Sep 17 00:00:00 2001 From: Alan Maynard Date: Thu, 28 Mar 2019 17:47:20 -0400 Subject: [PATCH] SWF-12 Update navigation --- .../Base.lproj/Interface.storyboard | 17 ++++++++--------- .../AccountTableInterfaceController.swift | 6 ++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/SynchronyFinancial/SynchronyFinancial WatchKit App/Base.lproj/Interface.storyboard b/SynchronyFinancial/SynchronyFinancial WatchKit App/Base.lproj/Interface.storyboard index 31d93dc..28bb61d 100644 --- a/SynchronyFinancial/SynchronyFinancial WatchKit App/Base.lproj/Interface.storyboard +++ b/SynchronyFinancial/SynchronyFinancial WatchKit App/Base.lproj/Interface.storyboard @@ -100,7 +100,6 @@ - @@ -113,10 +112,10 @@ - + - + - + @@ -168,7 +167,7 @@ - + @@ -190,12 +189,12 @@ - + - + - + @@ -219,7 +218,7 @@ - + diff --git a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/AccountTableInterfaceController.swift b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/AccountTableInterfaceController.swift index baa7b73..b72e5f9 100644 --- a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/AccountTableInterfaceController.swift +++ b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/AccountTableInterfaceController.swift @@ -12,6 +12,7 @@ import Foundation class AccountTableInterfaceController: WKInterfaceController { var accounts: [Account] = [] var acctDict: [String: Account] = [:] + var transactionDict: [String: [Transaction]] = [:] @IBOutlet weak var accountTable: WKInterfaceTable! override func awake(withContext context: Any?) { @@ -41,6 +42,11 @@ class AccountTableInterfaceController: WKInterfaceController { return nil } + override func table(_ table: WKInterfaceTable, didSelectRowAt rowIndex: Int) { + acctDict.updateValue(accounts[rowIndex], forKey: "acct") + self.presentController(withNames: ["AccountDetails", "Transactions"], contexts: [self.acctDict, self.transactionDict]) + } + private func configureRows() { accountTable.setNumberOfRows(accounts.count, withRowType: "account")