iOS source code download: stacked cells in groups

iOS source code download: stacked cells in groups

Supported platforms: iOS

Operating environment: iOS

Development language: Object-C

Development tools: Xcode

Source code size: 60.27KB

Source code download address: http://down..com/data/1975620

Source code introduction

The third-party library TFStackingSectionsTableView can stack cells in groups. The group header is displayed on the table, and clicking the group header can expand the corresponding cell.

Source code running screenshot

Rendering

Source code snippet

  1. - ( void )viewDidLoad
  2. {
  3. [super viewDidLoad];
  4.       
  5. self.groups = @[@ "Group A" , @ "Group B" , @ "Group C" , @ "Group D" , @ "Group E" , @ "Group F" , @ "Group G" , @ "Group H" ];
  6. self.members = @[
  7. @[@ "Brazil" , @ "Mexico" , @ "Croatia" , @ "Cameroon" ],
  8. @[@ "Netherlands" , @ "Chile" , @ "Spain" , @ "Australia" ],
  9. @[@ "Columbia" , @ "Greece" , @ "Côte D'Ivoire" , @ "Japan" ],
  10. @[@ "Costa Rica" , @ "Uraguay" , @ "Italy" , @ "England" ],
  11. @[@ "France" , @ "Switzerland" , @ "Ecuador" , @ "Honduras" ],
  12. @[@ "Argentina" , @ "Nigeria" , @ "Bosnia and Herzegovina" , @ "Iran" ],
  13. @[@ "Germany" , @ "USA" , @ "Portugal" , @ "Ghana" ],
  14. @[@ "Belgium" , @ "Algeria" , @ "Russia" , @ "Korea Republic" ]
  15. ];
  16. }
  17. - (UIView *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
  18. return self.groups[section];
  19. }
  20.   
  21. - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
  22. {
  23. return nil;
  24. UILabel *label = [UILabel new ];
  25. label.text = [@ " " stringByAppendingString:self.groups[section]];
  26. label.backgroundColor = [UIColor colorWithWhite:0.97f alpha:1.0];
  27. label.textColor = [UIColor colorWithWhite:0.13f alpha:1.0];
  28. label.font = [UIFont boldSystemFontOfSize:14.0f];
  29. return label;
  30. }

Source code download address: http://down..com/data/1975620

<<:  Android decompilation: decompilation tools and methods

>>:  iOS source code download: Implementing custom drawing functions

Recommend

How does Xiaohongshu operate its community?

As a product with community attributes as its mai...

Everything has its limits, and so does eating.

Author: Wang Ying, Chief Physician of Tianjin Men...

User operation: How to improve user retention/repurchase rate?

1. The necessity of strengthening retention/repur...

Android execs talk about Lollipop: Why it's a big update - CNET

[[122540]] In a few weeks, some Android phones on...

She is a true "light chaser", making the magic of the sun shine brightly in life

There has never been a lack of great women on the...

How did Nobuyuki Idei push Sony into the abyss of decline?

Undoubtedly, Sony has declined, or it can be said...

The price of iPhone 6's ultra-thinness: big trouble!

The iPhone 6 will be extremely thin and light. The...

New media operation: 4 suggestions on new media writing!

On the one hand, self-media people write public a...