WWRadioButton 0.1.0

WWRadioButton 0.1.0

Maintained by William-Weng.



  • By
  • 翁禹斌(William.Weng)

WWRadioButton

一個自訂的單選按鈕 (上傳至Cocoapods)

Swift 4.2 Version Platform License

一個自訂的單選按鈕 (上傳至Cocoapods)

使用範例

IBOutlet IBOutlet

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)
    }
}