From 1223e42c46129deb04ab863b287656b996fadae0 Mon Sep 17 00:00:00 2001 From: Aaron Date: Fri, 22 Jan 2021 13:00:20 -0500 Subject: [PATCH] Added endAlarm function. --- ProjectClock/AlarmActivationViewController.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) + } }