Common Operations for iOS-Swift to implement UITableView

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.