- IRSingleButtonGroup-swift is a powerful buttons group framework for iOS.
- See objc version in here: IRSingleButtonGroup.
- Single Button Selection.
- Single Button Selection Demo: Deselect able.
- Multi Buttons Selection.
- Add
pod 'IRSingleButtonGroup-swift'
in thePodfile
pod install
- more examples in the demo applications.
self.singleButtonGroup = IRSingleButtonGroup.init()
self.singleButtonGroup.buttons = [self.button1, self.button2, self.button3]
self.singleButtonGroup.delegate = self
// MARK: - SingleButtonGroupDelegate
func didSelectedButton(button: UIButton) {
NSLog("Button%ld", button.tag)
}
func didDeselectedButton(button: UIButton) {
NSLog("Button%ld", button.tag)
}
singleButtonGroup.canMultiSelected = false
singleButtonGroup.canSelectWhenSelected = true
singleButtonGroup.setInitSelected(selectedButton: button)