Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/113.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 无法调用非函数类型“UIScreen”的值_Ios_Swift - Fatal编程技术网

Ios 无法调用非函数类型“UIScreen”的值

Ios 无法调用非函数类型“UIScreen”的值,ios,swift,Ios,Swift,在这一行,我得到了上面的错误。根据以前的文章,我看到它在Swift 3.0中被修改了,但我不知道如何修复它。如何更改此设置?更改为window=UIWindowframe:UIScreen.main.bounds 主要更改是从.Main屏幕更改为.Main 主要是Swift 3将其许多函数调用更改为属性类型UIScreen.main.boundsFYI-这是Swift 2代码。其他人已经给出了答案,但没有给出如何获得答案。您应该做的是转到Xcode,从帮助菜单中选择Documentation a

在这一行,我得到了上面的错误。根据以前的文章,我看到它在Swift 3.0中被修改了,但我不知道如何修复它。如何更改此设置?

更改为window=UIWindowframe:UIScreen.main.bounds

主要更改是从.Main屏幕更改为.Main


主要是Swift 3将其许多函数调用更改为属性类型

UIScreen.main.boundsFYI-这是Swift 2代码。其他人已经给出了答案,但没有给出如何获得答案。您应该做的是转到Xcode,从帮助菜单中选择Documentation and API Reference,在UI屏幕上搜索,然后浏览文档的各个部分。您将很快找到可用屏幕,在该部分中,您将看到一个类变量main。或者,您可以尝试在该文档中搜索字符串main。
window = UIWindow(frame: UIScreen.mainScreen().bounds)