GitPedia

RadioGroup

The missing iOS radio buttons group.

From yonat·Updated February 25, 2026·View on GitHub·

[![Swift Version][swift-image]][swift-url] [![Build Status][travis-image]][travis-url] [![License][license-image]][license-url] The project is written primarily in Swift, distributed under the MIT License license, first published in 2019. Key topics include: radio-buttons, swift.

<img align="right" src="Screenshots/RadioGroup.png">

RadioGroup

Swift Version
Build Status
License
CocoaPods Compatible
Platform
PRs Welcome

The missing iOS radio buttons group.

Usage

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

SwiftUI Usage

swift
RadioGroupPicker(selectedIndex: $selection, titles: ["One", "Two", "Three"]) .fixedSize()

Changing Appearance

The properties below can be set in Interface Builder, in code, or through a UIAppearance proxy (e.g., RadioGroup.appearance().titleColor = .red).
When using SwiftUI you can set them in the RadioGroupPicker initializer, or use as view modifiers (e.g., .buttonSize(32)). .

Layout:

swift
radioGroup.isVertical = false // default is true => buttons are stacked vertically radioGroup.titleAlignment = .right radioGroup.isButtonAfterTitle = true // default is false => button left (leading) relative to title

Color and Font:

swift
radioGroup.tintColor = .green // surrounding ring radioGroup.selectedColor = .red // inner circle (default is same color as ring) radioGroup.selectedTintColor = .blue // selected radio button's surrounding ring (default is tintColor) radioGroup.titleColor = .blue radioGroup.titleFont = myFont

Or use attributed strings:

swift
radioGroup.attributedTitles = [ NSAttributedString(string: "Italic", attributes: [.obliqueness: 0.3]), NSAttributedString(string: "Underline", attributes: [.underlineStyle: 1]), ]

Size:

swift
radioGroup.buttonSize = 42.0 radioGroup.spacing = 12 // spacing between buttons radioGroup.itemSpacing = 12 // horizontal spacing between button and title

Button appearance:

swift
RadioButton.appearance().size = 32 // height=width of button RadioButton.appearance().ringWidth = 3 RadioButton.appearance().ringSpacing = 7 // space between outer ring and inner circle RadioButton.appearance().selectedColor = .blue // color of inner circle

Installation

CocoaPods:

ruby
pod 'RadioGroup'

Swift Package Manager:

swift
dependencies: [ .package(url: "https://github.com/yonat/RadioGroup", from: "1.4.10") ]

Meta

@yonatsharon

https://github.com/yonat/RadioGroup

Contributors

Showing top 3 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from yonat/RadioGroup via the GitHub API.Last fetched: 6/14/2026