Reputation: 9503
Environment:
Xcode Version 8.1 beta (8T47)
Apple Swift version 3.0.1 (swiftlang-800.0.56 clang-800.0.42)
The Swift 3.0.1 compiler flagged 'UIScreen' as '...no member'.
...but the UIScreen file does have 'main':
@available(iOS 2.0, *) open class UIScreen : NSObject, UITraitEnvironment {
@available(iOS 3.2, *)
open class var screens: [UIScreen] { get } // all screens currently attached to the device
open class var main: UIScreen { get } // the device's internal screen
I found numerous instances of a particular class not having a certain member.
And this was after converting the code to Swift 3.0.1 thru Xcode helper conversion function.
What gives?
Upvotes: 3
Views: 2159
Reputation: 1040
Swift3.0.1 Since UIScreen is UIKit framework's class.So make sure you have imported.
import UIKit
Upvotes: 3