Skip to content

The missing iOS radio buttons group.

License

Notifications You must be signed in to change notification settings

egorzaderiy/RadioGroup

 
 

Repository files navigation

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 and Font:

radioGroup.tintColor = .green // surrounding ring
radioGroup.selectedColor = .red // center circle (default is same color as ring)

radioGroup.titleColor = .blue
radioGroup.titleFont = myFont

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

About

The missing iOS radio buttons group.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 90.6%
  • Ruby 9.4%