diff --git a/ProjectClock/AddAlarmViewController.swift b/ProjectClock/AddAlarmViewController.swift
index b748f97..172b456 100644
--- a/ProjectClock/AddAlarmViewController.swift
+++ b/ProjectClock/AddAlarmViewController.swift
@@ -58,8 +58,11 @@ class AddAlarmViewController: UIViewController
wakeMethod: wvms[wvmPicker.selectedRow(inComponent: 0)],
lastActivate: Date())
- // TODO: Set alarm.repeats to correspond with what the user selects
-
+ // Set alarm.repeats to correspond with what the user selects
+ (0...6).forEach { alarm.repeats[$0] = false }
+ if repeatWeekdaysSwitch.isOn { (1...5).forEach { alarm.repeats[$0] = true } }
+ if repeatWeekendsSwitch.isOn { [0, 6].forEach { alarm.repeats[$0] = true } }
+ if (alarm.repeats.allSatisfy { !$0 }) { alarm.oneTime = true }
// Add the alarm to the list and save the list
Alarms.fromLocal().apply { $0.list.append(alarm) }.localSave();
diff --git a/ProjectClock/AlarmViewController.swift b/ProjectClock/AlarmViewController.swift
index 2fe4a13..06b1d9e 100644
--- a/ProjectClock/AlarmViewController.swift
+++ b/ProjectClock/AlarmViewController.swift
@@ -75,7 +75,7 @@ class AlarmTableCell: UITableViewCell
// displays the specific days alarm is activated
let daysDict = ["Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"]
var daysActive : [String] = []
- if alarm.oneTime {repeatText.text = "No Repeat"}
+ if alarm.oneTime {repeatText.text = "One-time Alarm"}
else {
for (index, element) in alarm.repeats.enumerated() {
if element {
diff --git a/ProjectClock/Base.lproj/Main.storyboard b/ProjectClock/Base.lproj/Main.storyboard
index cd44af6..dd71764 100644
--- a/ProjectClock/Base.lproj/Main.storyboard
+++ b/ProjectClock/Base.lproj/Main.storyboard
@@ -512,8 +512,24 @@
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
@@ -766,11 +766,11 @@
+
+
-
-
@@ -880,7 +880,7 @@
-
+