1. Preface Swift will not be introduced much here, so it should be well known to everyone. It took more than a month before Swift was available. In my spare time, I used Swift to implement some common UITableView operations. It is basically usable. I will share it with you in my blog today. 2. initialize the program entry initialization program entry. encapsulate a navigation controller in ViewController first! Does not represent nil ,? Nil (! And? The compiler will detect it based on different identifiers.) 3. Create a member variable and initialize UITableView var tableView: UITableView? Var items: NSMutableArray? Var leftBtn: UIButton? 4. add the Edit and Add buttons to the navigation controller. add a new TableViewCell 6. edit button function Delete and sort 7. data Source and proxy methods for implementing UITableView 7. 1. total number of rows 7. 2. content of each line 7. 3. whether to enable the editing Status 7. 4. delete A Cell line 7. 5. allow sliding to delete 7. 6. allow moving a row (sorting) 7. 7. sorting 7. 8. click a line
Author: Clear Saup
Source: http://www.cnblogs.com/qingche/
The copyright of this article is shared by the author and the blog. You are welcome to repost it, but you must keep this statement and provide a connection to the original article on the article page.