Skip to content

Commit

Permalink
✨ Add “done” button to unfocus reminder
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Friese <[email protected]>
  • Loading branch information
peterfriese committed Apr 26, 2022
1 parent 0f97bee commit 8dc8cfb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ class RemindersListViewModel: ObservableObject {
}
}

func unfocus() {
self.focusedReminder = nil
}

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ struct RemindersListView: View {
}
}
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
if focusedReminder != nil {
Button(action: viewModel.unfocus ) {
Text("Done")
}
}
}
ToolbarItemGroup(placement: .bottomBar) {
Button(action: { viewModel.createNewReminder() }) {
HStack {
Expand Down

0 comments on commit 8dc8cfb

Please sign in to comment.