This project is inspired by UISearch which provides perfect autohide header experience in UITableView.
AOPAutohideTableViewHeader takes advantage of the feature provided by UITableView itself. Provide a common way to implement a autohide header.
To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS 8.0 and Above
To install AOPAutohideTableViewHeader, simply add the following line to your Podfile:
# Uncomment line below if target is Swift project
# use_frameworks!
pod "AOPAutohideTableViewHeader", :git => 'https://github.com/aopod/AOPAutohideTableViewHeader'
If you'd rather import individual subspec you need, add:
# Uncomment line below if target is Swift project
# use_frameworks!
pod "AOPAutohideTableViewHeader/UIView", :git => 'https://github.com/aopod/AOPAutohideTableViewHeader'
or
# Uncomment line below if target is Swift project
# use_frameworks!
pod "AOPAutohideTableViewHeader/UITableView", :git => 'https://github.com/aopod/AOPAutohideTableViewHeader'
Provides class AOPAutohideTableHeaderView, contains a property aop_autohideMode
which enables you to specifying the autohide mode.
- AOPAutohideHeaderModeDefault = 0: Default behaviour
- AOPAutohideHeaderModeAutohide = 1: Autohide
- AOPAutohideHeaderModeNoAutohide = 2: No autohide
Note: When use in Interface Builder of Swift project, you need to reset tableHeaderView in code. like:
tableView.tableHeaderView = tableView.tableHeaderView
Provides AOPAutohideHeaderTableView, support specifying auto mode through code or Interface Builder. Provides a property aop_tableHeaderViewAutohideMode
.
- AOPAutohideHeaderModeDefault = 0: Default behaviour
- AOPAutohideHeaderModeAutohide = 1: Autohide
- AOPAutohideHeaderModeNoAutohide = 2: No autohide
Involves some private APIs, MAY cause AppStore rejection.
You can use this project in Swift project. Add use_frameworks!
to your Podfile as mentioned above. When you need use one of them, just import AOPAutohideTableViewHeader
Subspecs above both support Interface Builder in both Objective-C or Swift project. Assign value of property above to 0, 1, 2, can specify the corresponding autohide mode.
aopod, aopodcom@gmail.com
AOPAutohideTableViewHeader is available under the MIT license. See the LICENSE file for more info.