简体   繁体   English

无法调用非功能类型'UIScreen'的值

[英]Cannot call value of non-function type 'UIScreen'

window = UIWindow(frame: UIScreen.mainScreen().bounds)

On this line I get the above error. 在这一行,我得到上述错误。 Based on previous posts, I see that it got changed in Swift 3.0, but I can't figure out how to fix it. 根据以前的帖子,我看到它在Swift 3.0中有所改变,但我无法弄清楚如何修复它。 How do I change this? 我该如何改变?

Change to window = UIWindow(frame: UIScreen.main.bounds) 更改为window = UIWindow(frame: UIScreen.main.bounds)

Main change is from .mainScreen() to .main 主要更改是从.mainScreen().main

Mainly Swift 3 changes a lot of their function calls to be property-type 主要是Swift 3将很多函数调用更改为属性类型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM