WWRadioButton
一个自定义的单选按钮 (上传至 Cocoapods)
使用示例
import UIKit
import WWRadioButton
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
@IBAction func showButton(_ sender: WWRadioButton) {
sender.isTouched = true
guard let selectedButton = WWRadioButton.selectedButtonList[sender.groupIdentifier],
let nowSelectedButton = selectedButton
else {
return
}
print(nowSelectedButton.tag)
}
}