-
-
black_lq
2017-09-13
- #selector
-
截图
0赞 · 0采集
-
-
措言
2017-06-12
- click()
-
截图
0赞 · 0采集
-
-
措言
2017-06-12
- import UIKit
import PlaygroundSupport
class ViewController: UIViewController{
override func viewDidLoad(){
super.viewDidLoad()
self.view.backgroundColor = UIColor.yellow
self.view.frame = CGRect(x: 0, y: 0, width: 300, height: 400)
let button: UIButton = UIButton(frame: CGRect(x: 0, y: 0, width: 80, height: 40))
button.center = self.view.center
button.setTitle("click me!", for: .normal)
button.setTitleColor(.blue, for: .normal)
button.addTarget(self, action:"click", for: .touchUpInside)
button.addTarget(self, action:#selector(click), for: .touchUpInside)
self.view.addSubview(button)
}
func click(){
if view.backgroundColor == .yellow {
view.backgroundColor = .cyan
}
else {
view.backgroundColor = .yellow
}
}
}
-
截图
0赞 · 0采集
-
-
措言
2017-06-12
- import UIKit
import PlaygroundSupport
class ViewController: UIViewController{
override func viewDidLoad(){
super.viewDidLoad()
self.view.backgroundColor = UIColor.yellow
self.view.frame = CGRect(x: 0, y: 0, width: 300, height: 400)
let button: UIButton = UIButton(frame: CGRect(x: 0, y: 0, width: 80, height: 40))
button.center = self.view.center
button.setTitle("click me!", for: .normal)
button.setTitleColor(.blue, for: .normal)
button.addTarget(self, action:"click", for: .touchUpInside)
button.addTarget(self, action:#selector(click), for: .touchUpInside)
self.view.addSubview(button)
}
}
-
截图
0赞 · 0采集
-
-
吹泡泡的星星
2016-12-09
- 使用playground
-
截图
0赞 · 0采集
-
-
ichang
2016-11-29
- 可视化最后设置属性.view
-
截图
0赞 · 0采集
-
-
ichang
2016-11-29
- 可视化
-
截图
0赞 · 0采集