GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - peterpaulis/StaticDataTableViewController: Enables animated hide/show of static cells and sections

BranchesTags
Open more actions menu

Latest commit

 

History

89 Commits
89 Commits

Folders and files

NameName
Last commit message
Last commit date
StaticDataTableViewControllerFramework
StaticDataTableViewControllerFramework
 
 
StaticTableViewControllerSample
StaticTableViewControllerSample
 
 
.gitignore
.gitignore
 
 
Apache_License_2_0.txt
Apache_License_2_0.txt
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
StaticDataTableViewController.h
StaticDataTableViewController.h
 
 
StaticDataTableViewController.m
StaticDataTableViewController.m
 
 
StaticDataTableViewController.podspec
StaticDataTableViewController.podspec
 
 
demoapp.jpg
demoapp.jpg
 
 

Repository files navigation

Carthage compatible

StaticDataTableViewController

This class enables animated hide/show of static cells and sections (created in IB, using the option Content : Static cells) for UITableView

This method doesn't use the hacky solution with setting height to 0 and allows you to animate the change and hide whole sections

Features

  • Animations on cells and sections
  • Change height / Resize cells
  • Not using the hacky solution with height 0
  • Hide empty sections
  • Control section header, footer visibility for empty sections

Demo app Created with Vernissage app

Installation with CocoaPods

To integrate StaticDataTableViewController into your Xcode project using CocoaPods, specify it in your Podfile:

  pod 'StaticDataTableViewController'

Usage

Subclass your UITableViewController with the StaticDataTableViewController

#import "StaticDataTableViewController.h"

@interface DemoTableViewController : StaticDataTableViewController

@end

Always use this method for table view reload

- (void)reloadDataAnimated:(BOOL)animated) 

don't call [self.tableView reloadData]

To hide/show specific cells, to which you have an outlet or an outlet collection

[self cell:self.outletToMyStaticCell1 setHidden:YES];
[self cell:self.outletToMyStaticCell2 setHidden:NO];
[self cells:self.outletToManyCells setHidden:YES];
[self reloadDataAnimated:YES];
  • if you want to hide the whole section, just create a IBOutletCollection to all its cell, and then use [self cells:setHidden:]

To change height of specific cells, to which you have an outlet or an outlet collection

[self cell:self.outletToMyStaticCell1 setHeight:44];
[self cell:self.outletToMyStaticCell2 setHeight:44];
[self cells:self.outletToManyCells setHeight:200];
[self reloadDataAnimated:YES];

to customize animations, just set these properties to desired values

self.insertTableViewRowAnimation = UITableViewRowAnimationRight;
self.deleteTableViewRowAnimation = UITableViewRowAnimationLeft;
self.reloadTableViewRowAnimation = UITableViewRowAnimationMiddle;

or call reloadDataAnimated:insertAnimation:reloadAnimation:deleteAnimation: with desired animation values

to control if the footer or header should be displayed, overwrite these methods in your subclass

- (BOOL)showHeaderForSection:(NSInteger)section vissibleRows:(NSInteger)vissibleRows;
- (BOOL)showFooterForSection:(NSInteger)section vissibleRows:(NSInteger)vissibleRows;

Note

  • Create outlets to UITableViewsCells, not their content views!

License

Apache License 2.0: http://www.apache.org/licenses/LICENSE-2.0.txt

Credits

min:60 - Building mobile solutions - https://min60.com

About

Enables animated hide/show of static cells and sections

Resources

Readme
Activity

Stars

396 stars

Watchers

18 watching

Forks

44 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.