[O] Fix AddAlarmViewController indents
This commit is contained in:
@@ -68,7 +68,7 @@ class AddAlarmViewController: UIViewController
|
|||||||
scrollView.addSubview(scrollViewInner)
|
scrollView.addSubview(scrollViewInner)
|
||||||
scrollView.contentSize = scrollViewInner.frame.size
|
scrollView.contentSize = scrollViewInner.frame.size
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pickers
|
// Pickers
|
||||||
@IBOutlet weak var timePicker: UIDatePicker!
|
@IBOutlet weak var timePicker: UIDatePicker!
|
||||||
@IBOutlet weak var wvmPicker: UIPickerView!
|
@IBOutlet weak var wvmPicker: UIPickerView!
|
||||||
@@ -82,10 +82,11 @@ class AddAlarmViewController: UIViewController
|
|||||||
@IBOutlet weak var viewTitle: UILabel!
|
@IBOutlet weak var viewTitle: UILabel!
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Removes the currently selcted alarm.
|
Removes the currently selcted alarm.
|
||||||
Returns the removed Alarm object.
|
Returns the removed Alarm object.
|
||||||
*/
|
*/
|
||||||
func removeCurrentAlarm() -> Alarm? {
|
@discardableResult
|
||||||
|
func removeCurrentAlarm() -> Alarm? {
|
||||||
let hours = Int(String(originalTime[...originalTime.index(originalTime.endIndex, offsetBy: -4 )]))!
|
let hours = Int(String(originalTime[...originalTime.index(originalTime.endIndex, offsetBy: -4 )]))!
|
||||||
let minutes = Int(String(originalTime.suffix(2)))!
|
let minutes = Int(String(originalTime.suffix(2)))!
|
||||||
|
|
||||||
@@ -101,8 +102,8 @@ class AddAlarmViewController: UIViewController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Called when the time for the alarm is changed.
|
Called when the time for the alarm is changed.
|
||||||
Sets the time away at the top of the View.
|
Sets the time away at the top of the View.
|
||||||
*/
|
*/
|
||||||
@IBAction func alarmTimeUpdated(_ sender: Any) {
|
@IBAction func alarmTimeUpdated(_ sender: Any) {
|
||||||
updateETA()
|
updateETA()
|
||||||
@@ -165,17 +166,17 @@ class AddAlarmViewController: UIViewController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Dynamically the ETA label for the alarm
|
Dynamically the ETA label for the alarm
|
||||||
*/
|
*/
|
||||||
func updateETA() {
|
func updateETA() {
|
||||||
//Create alarm without adding it to the queue.
|
//Create alarm without adding it to the queue.
|
||||||
let (h, m, _) = timePicker.date.getHMS()
|
let (h, m, _) = timePicker.date.getHMS()
|
||||||
|
|
||||||
// Create the alarm
|
// Create the alarm
|
||||||
let a = Alarm(hour: h, minute: m,
|
let a = Alarm(hour: h, minute: m,
|
||||||
text: alarmNameTextField.text ?? "Alarm",
|
text: alarmNameTextField.text ?? "Alarm",
|
||||||
wakeMethod: wvms[wvmPicker.selectedRow(inComponent: 0)],
|
wakeMethod: wvms[wvmPicker.selectedRow(inComponent: 0)],
|
||||||
lastActivate: Date(), alarmTone: ringtones[ringtonePicker.selectedRow(inComponent: 0)].tone)
|
lastActivate: Date(), alarmTone: ringtones[ringtonePicker.selectedRow(inComponent: 0)].tone)
|
||||||
// Set alarm.repeats to correspond with what the user selects
|
// Set alarm.repeats to correspond with what the user selects
|
||||||
(0...6).forEach { a.repeats[$0] = false }
|
(0...6).forEach { a.repeats[$0] = false }
|
||||||
if repeatWeekdaysSwitch.isOn { (1...5).forEach { a.repeats[$0] = true } }
|
if repeatWeekdaysSwitch.isOn { (1...5).forEach { a.repeats[$0] = true } }
|
||||||
|
|||||||
Reference in New Issue
Block a user