swift单选框和复选框
var selectindex:Int = 0//选中的
var lastbtn:MZNewMineBtn = MZNewMineBtn.init()//保存上一个按钮
//多选框
// btn.isSelected = !btn.isSelected
// if btn.isSelected == false {
// btn.backgroundColor = ColorCommentRed
// }else {
// btn.backgroundColor = ColorBlackAlpha10
// }
//单选框
letbtnTag:Int= btn.tag-10
btn.isSelected=true
lastbtn.isSelected=false
lastbtn.backgroundColor = ColorBlackAlpha10
btn.backgroundColor=ColorCommentRed
lastbtn= btn
selectindex= btnTag
网友评论