Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.