The missing iOS radio buttons group.
let radioGroup = RadioGroup(titles: ["First Option Title", "Another Option Title", "Last"])
radioGroup.selectedIndex = 0
radioGroup.addTarget(self, action: #selector(optionSelected), forControlEvents: .valueChanged)
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
pod 'RadioGroup'
Copy Sources/*.swift
and MiniLayout.swift
to your Xcode project.