简体   繁体   中英

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. How do I change this?

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

Main change is from .mainScreen() to .main

Mainly Swift 3 changes a lot of their function calls to be property-type

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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