-
drag
radioButton.swift
to project -
drag a
UIView
to Storyboard -
click
identity inspector
page, setting Custom class asradioButton
-
Connect by IBCollection
in swift file, it should look like
@IBOutlet var btns: [radioButton]!
-
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
}
}
- 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