https://github.com/bobek-balinek/uitableview-sticky-header
A single class to control and persist a fixed position of a header view when scrolling through a UITableView.
https://github.com/bobek-balinek/uitableview-sticky-header
ios scrolling scrollview tableviewheader uikit uitableview
Last synced: about 1 year ago
JSON representation
A single class to control and persist a fixed position of a header view when scrolling through a UITableView.
- Host: GitHub
- URL: https://github.com/bobek-balinek/uitableview-sticky-header
- Owner: bobek-balinek
- License: mit
- Created: 2018-10-31T12:28:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-31T12:31:52.000Z (over 7 years ago)
- Last Synced: 2025-01-31T16:15:04.035Z (over 1 year ago)
- Topics: ios, scrolling, scrollview, tableviewheader, uikit, uitableview
- Language: Swift
- Size: 3.91 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# uitableview-sticky-header
A single class to control and persist a fixed position of a header view when scrolling through a UITableView.
## Usage
```
class ViewController: UITableViewController {
@IBOutlet var myHeaderView: UIView!
var stickyHeaderController: StickyHeaderController!
override func viewDidLoad() {
super.viewDidLoad()
// Set up sticky header view
stickyHeaderController = StickyHeaderController(view: myHeaderView, height: 300)
stickyHeaderController.attach(to: self)
}
override func scrollViewDidScroll(_ scrollView: UIScrollView) {
super.scrollViewDidScroll(scrollView)
// Update the layout of the header view
stickyHeaderController.layoutStickyView()
}
}
```