From 768ee70944c1beb3b7f8128205b0fa661142050c Mon Sep 17 00:00:00 2001 From: Alan Maynard Date: Wed, 21 Nov 2018 22:42:00 -0500 Subject: [PATCH] Added outlets for buttons and `contextForSegue` method to handle navigation --- .../Base.lproj/Interface.storyboard | 4 ++++ .../MainMenuInterfaceController.swift | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/SynchronyFinancial/SynchronyFinancial WatchKit App/Base.lproj/Interface.storyboard b/SynchronyFinancial/SynchronyFinancial WatchKit App/Base.lproj/Interface.storyboard index 003d153..db708d7 100644 --- a/SynchronyFinancial/SynchronyFinancial WatchKit App/Base.lproj/Interface.storyboard +++ b/SynchronyFinancial/SynchronyFinancial WatchKit App/Base.lproj/Interface.storyboard @@ -37,6 +37,10 @@ + + + + diff --git a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/MainMenuInterfaceController.swift b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/MainMenuInterfaceController.swift index b942f95..de0e471 100644 --- a/SynchronyFinancial/SynchronyFinancial WatchKit Extension/MainMenuInterfaceController.swift +++ b/SynchronyFinancial/SynchronyFinancial WatchKit Extension/MainMenuInterfaceController.swift @@ -9,8 +9,9 @@ import WatchKit import Foundation - class MainMenuInterfaceController: WKInterfaceController { + @IBOutlet weak var accountsButton: WKInterfaceButton! + @IBOutlet weak var wellnessButton: WKInterfaceButton! override func awake(withContext context: Any?) { super.awake(withContext: context) @@ -28,4 +29,13 @@ class MainMenuInterfaceController: WKInterfaceController { super.didDeactivate() } + override func contextForSegue(withIdentifier segueIdentifier: String) -> Any? { + if segueIdentifier == "toAccounts" { + // we will probably want to do some setup prior to presenting Accounts + } else if segueIdentifier == "toWellness" { + // we will probably want to do some setup prior to presenting Wellness + } + + return nil + } }