Skip to content

Instantly share code, notes, and snippets.

@saoudrizwan
Created March 1, 2017 16:49
Show Gist options
  • Save saoudrizwan/64b6e3ed7051b3288bdec083e8c69069 to your computer and use it in GitHub Desktop.
Save saoudrizwan/64b6e3ed7051b3288bdec083e8c69069 to your computer and use it in GitHub Desktop.
Set a default implementation for a protocol function.
public protocol SwipeTableViewCellDelegate: class {
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> [SwipeAction]?
func tableView(_ tableView: UITableView, editActionsOptionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> SwipeTableOptions
}
/**
Default implementation of `SwipeTableViewCellDelegate` methods
*/
public extension SwipeTableViewCellDelegate {
func tableView(_ tableView: UITableView, editActionsOptionsForRowAt indexPath: IndexPath, for orientation: SwipeActionsOrientation) -> SwipeTableOptions {
return SwipeTableOptions()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment