Documentation Archive Developer
Search

ScreenSaver Changes for Swift

ScreenSaver

Removed ScreenSaverView.animationTimeInterval() -> NSTimeInterval
Removed ScreenSaverView.isAnimating() -> Bool
Removed ScreenSaverView.isPreview() -> Bool
Removed ScreenSaverView.setAnimationTimeInterval(_: NSTimeInterval)
Declaration
From
class ScreenSaverDefaults : NSUserDefaults {
    class func defaultsForModuleWithName(_ inModuleName: String!) -> AnyObject!
}
To
class ScreenSaverDefaults : NSUserDefaults {
    convenience init?(forModuleWithName inModuleName: String)
    class func defaultsForModuleWithName(_ inModuleName: String) -> Self?
}

NameDeclarationIntroduction
FromdefaultsForModuleWithName(_:)
class func defaultsForModuleWithName(_ inModuleName: String!) -> AnyObject!
OS X 10.10
Toinit(forModuleWithName:)
convenience init?(forModuleWithName inModuleName: String)
OS X 10.11

Declaration
From
class ScreenSaverView : NSView {
    class func backingStoreType() -> NSBackingStoreType
    class func performGammaFade() -> Bool
    init!(frame frame: NSRect)
    init!(frame frame: NSRect, isPreview isPreview: Bool)
    func animationTimeInterval() -> NSTimeInterval
    func setAnimationTimeInterval(_ timeInterval: NSTimeInterval)
    func startAnimation()
    func stopAnimation()
    func isAnimating() -> Bool
    func drawRect(_ rect: NSRect)
    func animateOneFrame()
    func hasConfigureSheet() -> Bool
    func configureSheet() -> NSWindow!
    func isPreview() -> Bool
}
To
class ScreenSaverView : NSView {
    class func backingStoreType() -> NSBackingStoreType
    class func performGammaFade() -> Bool
    convenience init?(frame frame: NSRect)
    init?(frame frame: NSRect, isPreview isPreview: Bool)
    var animationTimeInterval: NSTimeInterval
    func startAnimation()
    func stopAnimation()
    var animating: Bool { get }
    func drawRect(_ rect: NSRect)
    func animateOneFrame()
    func hasConfigureSheet() -> Bool
    func configureSheet() -> NSWindow?
    var preview: Bool { get }
}

Declaration
From
func configureSheet() -> NSWindow!
To
func configureSheet() -> NSWindow?

Modified ScreenSaverView.init(frame: NSRect)
Declaration
From
init!(frame frame: NSRect)
To
convenience init?(frame frame: NSRect)

Declaration
From
init!(frame frame: NSRect, isPreview isPreview: Bool)
To
init?(frame frame: NSRect, isPreview isPreview: Bool)