MBRadioCheckboxButton2 2.0.1

MBRadioCheckboxButton2 2.0.1

Apin Ridwan 维护。



  • Swifty-iOS

RadioAndCheckboxButton

RadioButtonCheckboxButton 是 UIButton 控件的子类。您可以使用 RadioButton 和 CheckboxButton 与 UIButton 一样。它为你提供了动画和不同的按钮样式。您可以分组按钮以利用更多功能。它会自动管理 RadioButton 和 CheckboxButton 的所有选择/取消选择。

CheckboxButton

默认样式

自定义样式

RadioButton

默认样式

自定义样式

安装说明

CocoaPods

CocoaPods 是 Cocoa 项目的依赖管理器。您可以使用以下命令安装它:

$ gem install cocoapods

要使用 CocoaPods 将 RadioButton 和 CheckboxButton 集成到您的 Xcode 项目中,请在其 Podfile 中指定它。

target '<Your Target Name>' do
    pod 'MBRadioCheckboxButton'
end

如果需要,您可以单独集成按钮控件。

target '<Your Target Name>' do
    pod 'MBRadioButton'
end
target '<Your Target Name>' do
    pod 'MBCheckboxButton'
end

然后,运行以下命令:

$ pod install

使用方法

使用方法简单易懂。只需将 RadioButtonCheckboxButton 分配到 XIB 中的按钮即可。您可以使用 [RadioButtonContainerView](Source/RadioButton/RadioButtonContainerView.swift)或 CheckboxButtonContainerView 利用分组按钮。将所有按钮添加到 UIView 中,并将相应的容器类分配给视图。有关更多详细信息,请参阅 RadioAndCheckboxButtonDemo 示例。该示例包含 CheckboxButtonDelegateRadioButtonDelegate,用于获取按钮选中或取消选中的回调。

自定义

更多信息请参考单选框和复选按钮示例

许可证

MIT