bananaRanger / AYSegmentControl

A special control that provides one or more buttons in a single view for selecting between different screens, views, or modes in your app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AYSegmentControl

CI Status Version License Platform

A special control that provides one or more buttons in a single view for selecting between different screens, views, or modes in your app.

Demo

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

About

A special control that provides one or more buttons in a single view for selecting between different screens, views, or modes in your app.

Installation

AYSegmentControl is available through CocoaPods. To install it, simply add the following line to your Podfile:

inhibit_all_warnings!

target 'YOUR-TARGET-NAME' do
  use_frameworks!
	pod 'AYSegmentControl'
end

Usage

// 'segmentControl' - object of class 'AYSegmentControl' (control).
// 'titles' - object of class '[String]' (titles list).

segmentControl.segmentTitles = titles
segmentControl.isSelectionIndicatorHidden = false

segmentControl.selectedTextColor = .darkText
segmentControl.textColor = .lightGray
segmentControl.lineColor = .purple

segmentControl.lineHeight = 2
segmentControl.lineCornerRadius = segmentControl.lineHeight / 2
segmentControl.select(segment: 0, with: false)

Author

Anton Yereshchenko

License

AYSegmentControl is available under the MIT license. See the LICENSE file for more info.

About

A special control that provides one or more buttons in a single view for selecting between different screens, views, or modes in your app.

License:MIT License


Languages

Language:Swift 91.9%Language:Ruby 8.1%