Created
March 1, 2017 16:49
-
-
Save saoudrizwan/64b6e3ed7051b3288bdec083e8c69069 to your computer and use it in GitHub Desktop.
Set a default implementation for a protocol function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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