当前位置: 动力学知识库 > 问答 > 编程问答 >

ios - Where is this object named "view" instantiated?

问题描述:

We're able to use the view object to change the background color property, however where is this object named "view" created or instantiated?

 import UIKit

class ViewController: UIViewController {

override func viewDidLoad() {

super.viewDidLoad()

// Do any additional setup after loading the view, typically from a nib.

print("test")

view.backgroundColor=UIColor.redColor()

if (view.backgroundColor==UIColor.redColor()){

view.backgroundColor=UIColor.yellowColor()

} else if (view.backgroundColor==UIColor.yellowColor()) {

view.backgroundColor=UIColor.redColor()

}

view.backgroundColor=UIColor.yellowColor()

}

override func didReceiveMemoryWarning() {

super.didReceiveMemoryWarning()

// Dispose of any resources that can be recreated.

}

}

分享给朋友:
您可能感兴趣的文章:
随机阅读: