Skip to content

Instantly share code, notes, and snippets.

@igroomgrim
Created November 10, 2015 03:53
Show Gist options
  • Save igroomgrim/8830a0d40cb8b2320622 to your computer and use it in GitHub Desktop.
Save igroomgrim/8830a0d40cb8b2320622 to your computer and use it in GitHub Desktop.
Update/Edit to-do task object and show status in tableview.
let realm = try! Realm()
realm.beginWrite()
task.title = titleTextField.text!
task.taskDescription = descriptionTextView.text
if statusSwitch.on {
task.done = true
} else {
task.done = false
}
try! realm.commitWrite()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment