Skip to content

ACC-GIT/radioButton-swift

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

radioButton-swift

Very basic radio button

easy to use

  1. drag radioButton.swift to project

  2. drag a UIButton to Storyboard

  3. click identity inspector page, setting Custom class as radioButton
    set button style frome system to custom

  4. Connect by IBCollection

    in swift file, it should look like
    @IBOutlet var btns: [radioButton]!

  5. Connect every radio button by Touch up inside to SAME method

@IBAction func test(_ sender: UIButton) {
        
        for btn in self.btns {
            if btn == sender {
                btn.isSelected = true
            }
            else {
                btn.isSelected = false
            }
        }
    }

All property

  • line Color: outter circle line color
  • fill Color: inner circel filled color
  • padding: padding between circle and text (maybe not adjust it)
  • line width: outter circle line width

About

Very basic radio button

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%