swift global constants: cannot use another constant for initialization

后端 未结 3 935
时光说笑
时光说笑 2021-01-14 20:10

Here is what I am trying to do:

class ViewController: UIViewController {
let screenRect: CGRect = UIScreen.mainScreen().bounds
let screenWidth = screenRect.w         


        
3条回答
  •  旧巷少年郎
    2021-01-14 20:18

    Its not possible to access self before initialisation process gets completed, therefore its giving error.

提交回复
热议问题