MacRadio控件是iOS单选按钮的UI控件,主要用于在编程中构建各种单选框,支持分组,调换默认单选按钮,具有兼容性强,运行稳定的特点,大大提高iOS程序开发效率。有需要的朋友快快下载吧!

源码实现方法
#import
@protocol RadioButtonDelegate
-(void)radioButtonSelectedAtIndex:(NSUInteger)index inGroup:(NSString*)groupId;
@end
@interface ZYRadioButton : UIView{
NSString *_groupId;
NSUInteger _index;
UIButton *_button;
}
//GroupId
@property(nonatomic,retain)NSString *groupId;
//Group的索引
@property(nonatomic,assign)NSUInteger index;
//初始化RadioButton控件
-(id)initWithGroupId:(NSString*)groupId index:(NSUInteger)index;
//为
+(void)addObserverForGroupId:(NSString*)groupId observer:(id)observer;
@end
ZYViewController.m(视图控制器中的代理方法):
//代理方法
-(void)radioButtonSelectedAtIndex:(NSUInteger)index inGroup:(NSString *)groupId{
NSLog(@"changed to %d in %@",index,groupId);
}