-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameEndController.swift
45 lines (33 loc) · 1018 Bytes
/
GameEndController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// GamePauseController.swift
// BeaverAndFairiesWatch
//
// Created by Sasha Khotiashov on 2/7/17.
// Copyright © 2017 Sasha Khotiashov. All rights reserved.
//
import WatchKit
import Foundation
class GameEndController: WKInterfaceController {
@IBOutlet var scoreLabel: WKInterfaceLabel!
override func awake(withContext context: Any?) {
super.awake(withContext: context)
}
override func willActivate() {
super.willActivate()
var firstLabelText = "Score: "
if GamePlayerController.newPlayerRecord == true {
firstLabelText = "New record: "
GamePlayerController.newPlayerRecord = false
}
scoreLabel.setText(firstLabelText + String(GamePlayerController.currentPlayerScore))
}
override func didDeactivate() {
super.didDeactivate()
}
@IBAction func replayPressed() {
pop()
}
@IBAction func backPressed() {
popToRootController()
}
}