Description: an experiment on how to separate the viewController from tableViewDataSource while at the same time reduce the tableView interaction code. Source Code
I started out with the wish to write a rounded UIView extension, which was quite easy to achieve. Somehow along the way I decided to revisit the previous Dribble code and make some improvement:
– a separate TableView DataSource handles the data manipulation and give feedback to the main ViewController when the user interaction is performed. The ViewController can then perform the corresponding view updates or other actions. In fact, almost all actions that triggered by user interaction can use the same function to call back the main ViewController:
The TableView Action types are custom defined:
The rounded UIView extension which can be called easily with: userImageView.round()