Skip to content

Commit

Permalink
SWF-21 Initial setup for “loading” during account tap
Browse files Browse the repository at this point in the history
- we may need to refine this a bit, but for now we display an alert that we are loading once the user taps their account
- it will auto-dismiss and push to account details when the web service returns
  • Loading branch information
ahm11003 committed Mar 28, 2019
1 parent 8487ce3 commit 24deb73
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ class AccountTableInterfaceController: WKInterfaceController {
}

override func table(_ table: WKInterfaceTable, didSelectRowAt rowIndex: Int) {
presentAlert(withTitle: "Loading...", message: "Loading Account Details and Recent Transactions", preferredStyle: .alert, actions: [WKAlertAction(title: "cancel", style: .cancel, handler: {
self.dismiss()
})])
acctDict.updateValue(accounts[rowIndex], forKey: "acct")
FetchData.fetchTransactionsFor(accountAlias: accounts[rowIndex].accountAlias) { transactions, error in
guard error == nil else { return }
self.transactionDict.updateValue(transactions, forKey: "transactions")
self.dismiss()
self.presentController(withNames: ["AccountDetails", "Transactions"], contexts: [self.acctDict, self.transactionDict])
}
}
Expand Down

0 comments on commit 24deb73

Please sign in to comment.