Swiftpack.co -  alxrguz/ALRadioButtons as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
RadioButtons for iOS. Inherited from UIControl, support 2 native styles, fully customizable.
.package(url: "https://github.com/alxrguz/ALRadioButtons.git", from: "1.2.2")




  • iOS 10.0 +
  • Swift 4.2 +


Swift Package Manager

The Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

To integrate ALRadioButtons click File -> Swift Package -> Add Package Dependency and insert:



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

pod 'ALRadioButtons'


If you prefer not to use either of the aforementioned dependency managers, you can integrate ALRadioButtons into your project manually. Put Source/ALRadioButtons folder in your Xcode project.


Quick Start

import ALRadioButtons

class MyViewController: UIViewController {

    lazy var radioGroup = ALRadioGroup(items: [
        .init(title: "title1", subtitle: "subtitle1"),
        .init(title: "title2", subtitle: "subtitle2", detail: "Detail"),
        .init(title: "title3"),
    ], style: .grouped)

    override func viewDidLoad() {

        // ... Setup layout
        radioGroup.selectedIndex = 0
      	radioGroup.addTarget(self, action: #selector(radioGroupSelected(_:)), for: .valueChanged)
      	// If the checkbox selection can be canceled, then set this property to true 
      	radioGroup.allowDeselection = true
    @objc private func radioGroupSelected(_ sender: ALRadioGroup) {



You can customize the buttons, headers and indicators colors depending on their state.

radioGroup.selectedTitleColor = .systemBlue 
radioGroup.unselectedTitleColor = .black 
radioGroup.selectedDetailColor = .systemBlue
radioGroup.unselectedDetailColor = .black
radioGroup.selectedIndicatorColor = .systemBlue 
radioGroup.unselectedIndicatorColor = .systemBlue 
radioGroup.subtitleColor = .lightGray 
radioGroup.buttonBackgroundColor = .white 
radioGroup.separatorColor = .lightGray 


radioGroup.titleFont = .systemFont(ofSize: 16, weight: .medium)
radioGroup.detailFont = .systemFont(ofSize: 16, weight: .regular)
radioGroup.subtitleFont = .systemFont(ofSize: 13, weight: .regular)


radioGroup.cornerRadius = 14 // Button corner radius, actual for .grouped style
radioGroup.buttonHeight = 50 
radioGroup.subtitleTopOffset = 8 // Subtitle offset from title bottom anchor
radioGroup.separatorTopOffset = 8 // Separator offset from title or subtitle (if added) bottom anchor
radioGroup.indicatorRingWidth = 2 // Outer ring width of indicator
radioGroup.indicatorRingSize = 22 // Indicator outer ring size
radioGroup.indicatorCircleInset = 5 // Indentation of the circle from the outer ring


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


Stars: 55
Last commit: 3 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

Added detail label and Example App
7 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics