Swipe to Delete and the More button like in Mail app on iOS 7
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
The Mail-style swipe actions from the iOS 7 era were built on UITableView editing APIs, not on a hidden Mail-only component. If you wanted a row to reveal buttons such as Delete and More, the usual solution was to provide custom row actions for a swiped table view cell.
Use Table View Row Actions
For an iOS 7 style implementation, the key delegate method is tableView:editActionsForRowAtIndexPath:. It returns the actions that appear when the user swipes left on a row.
This gives you the familiar trailing buttons. The returned order affects how the actions are displayed, so test the exact arrangement you want.
Implement the More Action as a Secondary Menu
Delete usually maps directly to one model update. More is different because it typically reveals a second set of options such as Flag, Archive, or Mark as Read.
For the iOS 7 era, UIActionSheet was a common historical choice.
In production code, you would connect the selected action back to the underlying message model. The key point is that the More button is a gateway to secondary actions rather than a final action itself.
Keep the Data Source in Sync
The visual swipe UI is only half of the feature. The backing array has to stay consistent with the table view updates. If you animate a row deletion without removing the corresponding model item, the next reload can reinsert the row or cause index mismatches.
That matters even more when actions involve asynchronous work. If deleting a message also hits a server API, decide whether the UI should update optimistically or only after confirmation. Either strategy can work, but mixing them inconsistently creates confusing behavior.
Separate UI Code from Row Action Logic
It is tempting to put all business logic directly inside the row action block, but those blocks become hard to read quickly. A better pattern is to call helper methods for delete, archive, or additional menus.
That makes the swipe configuration easy to scan and keeps model-side behavior testable.
Modern Equivalent for Newer iOS Versions
If you are maintaining an old app while also targeting newer iOS versions, it is worth knowing the modern replacement. UITableViewRowAction was eventually superseded by UIContextualAction and UISwipeActionsConfiguration.
That is not what you would ship for a strict iOS 7 target, but it is useful context when maintaining older interaction patterns in a modern codebase.
Common Pitfalls
A common mistake is animating the row deletion without updating the underlying array. The table view may appear correct briefly and then break on the next reload.
Another issue is packing too much logic into the action handler blocks. Keep the handlers thin and move real work into helpers.
Developers also sometimes assume the Mail app behavior is a built-in mode they can enable. It is not. You implement the actions explicitly through table view APIs.
Finally, be careful with destructive gestures. Immediate delete on swipe is convenient, but important data may need confirmation or undo support.
Summary
- Mail-style swipe actions on iOS 7 are built with table view editing APIs.
- Use
tableView:editActionsForRowAtIndexPath:to provide Delete and More actions. - Keep the backing data source synchronized with any visual row change.
- Use the More action to expose secondary operations without crowding the cell.
- Prefer modern contextual swipe APIs only when the deployment target allows them.
Related reading
- Switching to a TabBar tab view programmatically?
- Switching to landscape mode in Android Emulator
- Symbol not found kUTTypeImage
- Sync data between Android App and webserver
- Sync in Android sqlite and sql server crud operation in two ways
- Tab not taking full width on Tablet device Using android.support.design.widget.TabLayout
- TabLayout tab selection
- Table Header Views in StoryBoards
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.