diff --git a/ProjectClock/AlarmActivationViewController.swift b/ProjectClock/AlarmActivationViewController.swift index 0513e0a..a53bbe1 100644 --- a/ProjectClock/AlarmActivationViewController.swift +++ b/ProjectClock/AlarmActivationViewController.swift @@ -71,10 +71,15 @@ class AlarmActivationViewController: UIViewController if let input = puzzleAnswerInput.text { if let numericalInput = Int(input) { if puzzleAnswers.contains(numericalInput) { - timer?.invalidate() - print("Alarm solved") + endAlarm() } } } } + + func endAlarm() { + timer?.invalidate() + print("Alarm solved") + dismiss(animated: true, completion: nil) + } }