Everyone needs a good editor..!!!✂️ Since , has provided us with the provision to add our own customized actions to a U_ITableView’s_ rows using the U_ITableViewDelegate_ method — t_ableView(_:editActionsForRowAt:)._ iOS 8 Apple tableView(_:editActionsForRowAt:) Asks the delegate for the actions to display in response to a swipe in the specified row. Use this method when you want to provide custom actions for one of your table rows. When the user swipes horizontally in a row, the table view moves the row content aside to reveal your actions. Tapping one of the action buttons executes the handler block stored with the action object. Now that is here, we have some new additions 🤓 to the table view’s editing API. Let’s see what’s in it for us.👀 iOS 11 What’s new in iOS 11? With the release of , introduced two new methods 😮 for handling in to support swipe actions on both leading as well as trailing edge of the row, i.e. iOS 11 Apple Swipe Actions UITableView swipe actions to display on the leading edge of the row tableView(_:leadingSwipeActionsConfigurationForRowAt:) — swipe actions to display on the trailing edge of the row tableView(_:trailingSwipeActionsConfigurationForRowAt:) — These methods were introduced as a part of UITableViewDelegate. Swipe Actions — Optional The methods to handle swipe actions in are , i.e. iOS 11 optional 😅 if implemented, supersede the delegate method. tableView(_:editActionsForRowAt:) if not implemented, will be called as the default behaviour. tableView(_:editActionsForRowAt:) Swipe Actions — Full Swipe In , swipe actions appear as by default 🤔, i.e the swipe spans the complete width of the iOS 11 Full Swipe UITableView. The behaviour can be configured using property 👏, introduced as a part of The set of actions to perform when swiping on rows of a table. Full Swipe performsFirstActionWithFullSwipe UISwipeActionsConfiguration — When this property is set to true, a full swipe in the row performs the first action listed in the actions property. The default value of this property is true. Promotions Don’t forget to read my other articles: Everything you’ve always wanted to know about notifications in iOS Drag It & Drop It in Collection & Table — iOS 11 Everything about Codable in Swift 4 Color it with GRADIENTS — iOS All you need to know about Today Extensions (Widget) in iOS 10 UICollectionViewCell selection made easy..!! Feel free to leave comments if you have any doubts. 🙂🙃
Share Your Thoughts