Skip to content

Commit

Permalink
Added outlets for buttons and contextForSegue method to handle navi…
Browse files Browse the repository at this point in the history
…gation
  • Loading branch information
ahm11003 committed Nov 22, 2018
1 parent f0c954c commit 768ee70
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
</connections>
</button>
</items>
<connections>
<outlet property="accountsButton" destination="8yj-m6-1L9" id="N4i-Zw-wUL"/>
<outlet property="wellnessButton" destination="Vth-km-gVm" id="jaB-M2-lvs"/>
</connections>
</controller>
</objects>
<point key="canvasLocation" x="105" y="102"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}
}

0 comments on commit 768ee70

Please sign in to comment.