Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ycui1
Created January 10, 2020 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ycui1/3fee5033b95a4ff5081a76eb1c8b9412 to your computer and use it in GitHub Desktop.
Save ycui1/3fee5033b95a4ff5081a76eb1c8b9412 to your computer and use it in GitHub Desktop.
func tableView(_ tableView: UITableView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) {
guard let identifier = (configuration.identifier as? NSString) as String? else { return }
let task = tasks.first { $0.id == identifier }
if task != nil {
animator.addCompletion {
let previewController = TaskPreviewController()
previewController.task = task
self.show(previewController, sender: self)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment