Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dkhamsing/scrolltab
Scrolling Tab for iOS
https://github.com/dkhamsing/scrolltab
ios objective-c
Last synced: about 17 hours ago
JSON representation
Scrolling Tab for iOS
- Host: GitHub
- URL: https://github.com/dkhamsing/scrolltab
- Owner: dkhamsing
- License: mit
- Created: 2014-02-01T06:56:28.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-07-09T15:19:57.000Z (over 7 years ago)
- Last Synced: 2024-11-07T14:44:50.374Z (8 days ago)
- Topics: ios, objective-c
- Language: Objective-C
- Homepage:
- Size: 1.96 MB
- Stars: 267
- Watchers: 17
- Forks: 36
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ScrollTab
A scroll tab alternative to `UISegmentedControl`.
![](Assets/demo.gif)
# Install
## [CocoaPods](https://cocoapods.org/)
``` ruby
pod 'ScrollTab'
```## Manual
Add the files in the `ScrollTab` folder to your project.
# Usage
``` objc
#import "ScrollTab.h"// ...
ScrollTabConfig *config = [[ScrollTabConfig alloc] init];
config.items = @[@"zero", @"one", @"two", @"three", @"four"];ScrollTab *tab = [[ScrollTab alloc] init];
tab.config = config;
tab.selected = ^(NSString *noop, NSInteger index) {
NSLog(@"selected tab with index %@", @(index));
};// Layout
[self.view addSubview:tab];
// ...
```## Customize
Change the control's layout, item font/colors and more using `ScrollTabConfig`.
# Demo
`ScrollTab` includes a sample project.
# Compatibility
This project was tested with iOS 10, see the [`1.x` tags](releases) for older versions.
# Contact
- [github.com/dkhamsing](https://github.com/dkhamsing)
- [twitter.com/dkhamsing](https://twitter.com/dkhamsing)# License
`ScrollTab` is available under the MIT license. See the [LICENSE](LICENSE) file for more info.