[O] Implement obj.apply {} like Kotlin

This commit is contained in:
Hykilpikonna
2021-01-17 16:34:20 -05:00
parent 7e4dc51da8
commit 2c5f28c97b
3 changed files with 22 additions and 5 deletions
+5 -2
View File
@@ -56,8 +56,11 @@ class AlarmActivator: UITabBarController
guard let alarm = alarms.listActivating.first else { return }
// Update alarm info
alarm.lastActivate = Date()
if alarm.oneTime { alarm.enabled = false }
alarm.apply {
$0.lastActivate = Date()
if $0.oneTime { $0.enabled = false }
}
alarms.localSave()
// Segue