The missing iOS radio buttons group.
Branch: master
Clone or download
Latest commit 6818b98 Feb 5, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Example bump version to 1.1.0 Feb 5, 2019
Screenshots minor doc fixes Feb 3, 2019
Sources add accessibility Feb 5, 2019
.gitignore initial Feb 3, 2019
.swiftformat initial Feb 3, 2019
.swiftlint.yml initial Feb 3, 2019
CHANGELOG.md bump version to 1.1.0 Feb 5, 2019
LICENSE.txt initial Feb 3, 2019
README.md tweak readme Feb 3, 2019
RadioGroup.podspec bump version to 1.1.0 Feb 5, 2019

README.md

RadioGroup

Swift Version Build Status License CocoaPods Compatible
Platform PRs Welcome

The missing iOS radio buttons group.

Usage

let radioGroup = RadioGroup(titles: ["First Option Title", "Another Option Title", "Last"])
radioGroup.selectedIndex = 0
radioGroup.addTarget(self, action: #selector(optionSelected), forControlEvents: .valueChanged)

Changing Appearance

Layout:

radioGroup.titleAlignment = .right
radioGroup.isButtonAfterTitle = true // default is false => button left (leading) relative to title

Color:

radioGroup.tintColor = .green // surrounding ring
radioGroup.selectedColor = .red // center circle

Size:

radioGroup.buttonSize = 42.0
radioGroup.spacing = 12 // vertical spacing between options
radioGroup.itemSpacing = 12 // horizontal spacing between button and title

Installation

CocoaPods:

pod 'RadioGroup'

Manually:

Copy Sources/*.swift and MiniLayout.swift to your Xcode project.

Meta

@yonatsharon

https://github.com/yonat/RadioGroup