NEUPagingSegmentedControl

Build Status Carthage compatible CocoaPods

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;

Run the example project:

pod install
open NEUPagingSegmentedControl.xcworkspace

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"

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.