开发者

Tableview section By Date

开发者 https://www.devze.com 2023-02-16 07:53 出处:网络
How to group da开发者_JAVA百科ta inthe tableview by date in Xcode? Have a look at the DateSectionTitles sample app. It demonstrates a tableview with date cells grouped by the month. It is based on Cor

How to group da开发者_JAVA百科ta in the tableview by date in Xcode?


Have a look at the DateSectionTitles sample app. It demonstrates a tableview with date cells grouped by the month. It is based on CoreData.

Tableview section By Date


First of all you need to find reasonable date groups: month, week, year-month combination etc. After that you'll have to find a method which can determine which of your cell has to go to which group/section, described as an NSIndexPath. numberOfSections as well as numberOfRowsInSection has to reflect your grouping idea. With the UITableViewDataSource protocol you can provide the names for your sections with titleForHeaderInSection:.

0

精彩评论

暂无评论...
验证码 换一张
取 消