Latest 0.2.2
Homepage https://github.com/attheodo/ATHMultiSelectionSegmentedControl
License MIT
Platforms ios 8.0
Frameworks UIKit, Foundation, QuartzCore
Authors

CI Status
Version
License
Platform
Language

Logo

ATHMultiSelectionSegmentedControl is a UIView based control mimicking the API of UISegmentedControl but also allowing for multiple selection of segments. It’s fully battle and unit-tested. If you find any bugs or want to suggest improvements please feel free to contribute.

Demo

Compatibility

  • Use swift2.2 branch for Swift 2.2
  • Use master branch for Swift 3.0

API

import ATHMultiSelectionSegmentedControl

// initialize empty segmented control
let segmentedControl = ATHMultiSelectionSegmentedControl()

// Add items to segmented control at once...
segmentedControl.insertSegmentsWithTitles(["Segment 1", "Segment 2", "Segment 3"])

// ... or one by one
segmentedControl.insertSegmentWithTitle("Segment 4", atIndex: 3, animated: true)

// Get and set items
segmentedControl.titleForSegmentAtIndex(0) // Segment 1
segmentControl.setTitle("Title", forSegmentAtIndex: 0)
segmentedControl.titleForSegmentAtIndex(0) // Title

// Enable or disable an option
segmentedControl.setEnabled(false, forSegmentAtIndex: 0) // "Title" segment is now disabled
segmentedControl.isEnabledForSegmentAtIndex(0) // false
segmentedControl.setEnabled(true, forSegmentAtIndex: 0) // "Title" segment is now enabled
segmentedControl.isEnabledForSegmentAtIndex(0) // true 

Example

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

Installation

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

pod "ATHMultiSelectionSegmentedControl"

Author

attheodo, [email protected]

License

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

Changelog

  • v0.2.0, September 2016
    • Migration to Swift 3.0
  • v0.1.1, July 2016
    • Bug fixes for tinting and button insertion
  • v0.1.0, May 2016
    • Initial release

Latest podspec

{
    "name": "ATHMultiSelectionSegmentedControl",
    "version": "0.2.2",
    "summary": "A control mimicking UISegmentedControl behaviour but allowing for multiple segment selection",
    "description": "ATHMultiSelectionSegmentedControl is a UIView based control that mimicks UISegmentedControl's API but also allows for multiple segment selection. It's battle tested and fully tested. If you find any bugs or want to suggest improvements please feel free to contribute.'",
    "homepage": "https://github.com/attheodo/ATHMultiSelectionSegmentedControl",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "attheodo": "[email protected]"
    },
    "source": {
        "git": "https://github.com/attheodo/ATHMultiSelectionSegmentedControl.git",
        "tag": "0.2.2"
    },
    "social_media_url": "https://twitter.com/attheodo",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ATHMultiSelectionSegmentedControl/Classes/**/*",
    "frameworks": [
        "UIKit",
        "Foundation",
        "QuartzCore"
    ],
    "pushed_with_swift_version": "3.2"
}

Pin It on Pinterest

Share This