Swift
来源:互联网 发布:数据库笔试查询及答案 编辑:程序博客网 时间:2024/05/16 19:38
// 按钮点击事件
func onTouchUpInside() {
struct touchUpInside {
static var count: Int = 0
}
touchUpInside.count += 1
print(touchUpInside.count)
if touchUpInside.count % 2 == 0 {
newsView.frame = CGRectMake(10, 22, UIScreen.mainScreen().bounds.size.width - 50, 40)
} else {
newsView.frame = CGRectMake(10, 22, UIScreen.mainScreen().bounds.size.width - 50, UIScreen.mainScreen().bounds.size.height - 20)
}
}