bcylin / NEUPagingSegmentedControl

A horizontal segmented control that works with UIScrollView paging.

Home Page:https://bcylin.github.io/NEUPagingSegmentedControl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NEUPagingSegmentedControl

Build Status Carthage compatible

A horizontal segmented control that works with UIScrollView paging.

  • Indicate the corresponding segment as the scroll view scrolls.
  • Scroll to a page by selecting the segment title.
  • Support device rotation.

Screenshot

Usage

[[NEUPagingSegmentedControl alloc] initWithFrame:CGRectMake(0, 0, 320, 44)
                                   segmentTitles:@[@"Title 1", @"Title 2", @"Title 3"];
                                      scrollView:scrollView];

Delegate method (optional):

- (void)pagingSegmentedControl:(NEUPagingSegmentedControl *)segmentedControl didSelectSegmentAtIndex:(NSInteger)index;

Requirements

NEUPagingSegmentedControl requires ARC with iOS 7 and above.

Installation

Install via CocoaPods

  • Create a Podfile with the following specification and run pod install.
platform :ios, '7.0'

pod 'NEUPagingSegmentedControl', git: 'https://github.com/bcylin/NEUPagingSegmentedControl.git'

Install via Carthage

  • Compatible with iOS 8 and above.
  • Create a Cartfile with the following specification and run carthage bootstrap.
github "bcylin/NEUPagingSegmentedControl" >= 0.3.0
  • Follow the instructions to add the framework to an iOS project.

Install Manually

  • Copy files in the Source directory to an iOS project.

License

NEUPagingSegmentedControl is released under the MIT license. See LICENSE.md for more info.

About

A horizontal segmented control that works with UIScrollView paging.

https://bcylin.github.io/NEUPagingSegmentedControl

License:MIT License


Languages

Language:Objective-C 91.7%Language:Ruby 8.3%