Revert "Merge branch 'main' of github.com:hykilpikonna/ProjectClock into main"
This reverts commitecd15bb30a, reversing changes made toacfcdbed24.
This commit is contained in:
@@ -12,41 +12,41 @@ class AlarmActivationViewController: UIViewController
|
||||
{
|
||||
var timer: Timer?
|
||||
var currentAlarm: Alarm?
|
||||
|
||||
|
||||
//Outlets
|
||||
@IBOutlet weak var puzzleView: UIView!
|
||||
@IBOutlet weak var puzzleQuestionLabel: UILabel!
|
||||
@IBOutlet weak var puzzleAnswerInput: UITextField!
|
||||
var puzzleAnswers: [Int] = []
|
||||
|
||||
|
||||
init?(coder: NSCoder, currentAlarm: Alarm)
|
||||
{
|
||||
self.currentAlarm = currentAlarm
|
||||
//print(currentAlarm.wakeMethod)
|
||||
super.init(coder: coder)
|
||||
}
|
||||
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
|
||||
override func viewDidLoad()
|
||||
{
|
||||
super.viewDidLoad()
|
||||
//Hide all inactive wakemethods
|
||||
puzzleView.isHidden = true
|
||||
|
||||
|
||||
timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(AlarmActivationViewController.playSound), userInfo: nil, repeats: true)
|
||||
setAlarmType()
|
||||
print(MathExpression.random())
|
||||
}
|
||||
|
||||
|
||||
@objc func playSound()
|
||||
{
|
||||
AudioServicesPlayAlertSound(SystemSoundID(1005))
|
||||
AudioServicesPlayAlertSound(kSystemSoundID_Vibrate)
|
||||
}
|
||||
|
||||
|
||||
func setAlarmType()
|
||||
{
|
||||
if let alarm = currentAlarm
|
||||
@@ -66,13 +66,10 @@ class AlarmActivationViewController: UIViewController
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@IBAction func checkPuzzleSolution(_ sender: Any) {
|
||||
if puzzleAnswers.contains(Int(puzzleAnswerInput.text!)!) {
|
||||
print("alarm solved")
|
||||
}
|
||||
@IBAction func debugForceStop(_ sender: Any)
|
||||
{
|
||||
timer?.invalidate()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user