Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noppefoxwolf/pager
A small horizontal paging library
https://github.com/noppefoxwolf/pager
Last synced: 29 days ago
JSON representation
A small horizontal paging library
- Host: GitHub
- URL: https://github.com/noppefoxwolf/pager
- Owner: noppefoxwolf
- License: mit
- Created: 2024-02-02T14:19:36.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-16T10:19:03.000Z (about 2 months ago)
- Last Synced: 2024-09-16T11:55:56.497Z (about 2 months ago)
- Language: Swift
- Homepage:
- Size: 28.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pager
UICollectionView based Pager ViewController.
![](.github/sample.gif)
# Usage
```swift
final class PageViewController: Pager.PageViewController, Pager.PageTabBarDataSource, Pager.PageViewControllerDataSource {
override func viewDidLoad() {
super.viewDidLoad()
dataSource = self
pageTabBar.dataSource = self
navigationItem.title = "Pager Example"
navigationItem.add(pageTabBar)
reloadData()
}
func barItem(for bar: Pager.PageTabBar, at index: Int) -> String {
"\(index)"
}
func numberOfViewControllers(in pageViewController: Pager.PageViewController) -> Int {
3
}
func viewController(for pageViewController: Pager.PageViewController, at index: Int) -> UIViewController? {
UIHostingController(rootView: Text("\(index)"))
}
}
```## Contributing
Let people know how they can contribute into your project. A contributing guideline will be a big plus.
## License
This project is licensed under the terms of the MIT license. See the [LICENSE](LICENSE) file for details.