@IBAction func changeAction(sender:UIButton){
var tag :Int = sender.tag
switch tag {
case 1 :
commonButton!.selected = true
phoneButton!.selected = false
notifiactionButton!.selected = false
bgScrollView!.setContentOffset(CGPointMake(0, 0), animated: true)
case 2 :
commonButton!.selected = false
phoneButton!.selected = true
notifiactionButton!.selected = false
bgScrollView.setContentOffset(CGPointMake(320, 0), animated: true)
case 3 :
commonButton!.selected = false
phoneButton!.selected = false
notifiactionButton!.selected = true
bgScrollView.setContentOffset(CGPointMake(640, 0), animated: true)
default:
print(" ")
}
}
在Swift中 必添加 default 并且里面必须有内容