Skip to content

xxi511/radioButton-swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

radioButton-swift

Very basic radio button

easy to use

  1. drag radioButton.swift to project

  2. drag a UIView to Storyboard

  3. click identity inspector page, setting Custom class as radioButton

  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: radioButton) {  
    for btn in self.btns {
        btn.radioSelected = (btn == sender) ? true: false
    }
}

All property

  • title: button title
  • Color: text color and outter circle color
  • Fill Color: inner circle color
  • padding: padding between text and circle, it work fine if button auto resize by itself
  • line width: line widht of outter circle
  • inner Multiple: CGFloat, how big the inner circle is
    can set [0~1] 1 means as big as outter circle, 0.5 meas half of outter circle
  • Text size: text size
  • Radio Selected: the selected status of radio button

About

Very basic radio button

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages