Chapter 12
Table Row Deletion, Swipe for Actions, Activity Controller and MVC
If you spend too much time thinking about a thing, you'll never get it done. Make at least one definite move daily toward your goal.
– Bruce Lee
In the earlier chapter, you learned how to handle table row selection. But how about deletion? How can we delete a row from a table view? It's a common question when building a table-based app. Select, delete, insert and update are the basic operations when dealing with data. We've discussed how to select a table row. Let's talk about deletion in this chapter. In addition, we'll go through a couple of new features to the FoodPin app:
- Adding a custom action button when a user swipes horizontally in a table row. This is usually known as Swipe for More action.
- Adding a social sharing feature to the app, that enables users to easily share the restaurants.
There is a lot to learn in this chapter, but it's going to be fun and rewarding. Let's get started.
A Brief Introduction to Model View Controller
We briefly mentioned the term MVC in the previous chapter when organizing the source files. Before jumping into the coding part, I would like to give you an introduction of Model-View-Controller (MVC) model, which is one of the most quoted design patterns for user interface programming.
I try to keep this book as practical as possible and seldom talk about the programming theories. Similar to OOP, if your ultimate goal is to become a professional developer, you can't avoid learning Model-View-Controller. MVC is not a concept that applies to iOS programming only. You may have heard of it if you've studied other programming languages, such as Java or Ruby. It is a powerful design pattern used in designing software applications, whether it is a mobile app and a web app.
To access the full version of the book, please get the full copy here. You will also be able to access the full source code of the project.