This is a simple UIButton
subclass to be used to add a circular radio button. You can use it by subclass a UIButton
from the storyboard or create the button programmatically. You can see the sample usage inside the Example Project.
You can download the project and drag and drop the MRRadioButton.swift
file.
To install it via cocoapods, add the following to your podfile
pod 'MRRadioButton'
Please note that right now this is only for a circular radio button
let button = MRRadioButton(frame: CGRect(x: 0.0, y: 0.0, width : 30.0, height : 30.0))
UIButton
.Just call the following method whenever you want to update the button state
button.updateSelection(select: true, animated: true)
You can fetch the current status of the button via the read-only property currentlySelected
backgroundFillColor - This will be the background color to fill the button with
borderColor - Border color of the UIButton
borderWidth - Border width of the UIButton