Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

You cannot use the screensaver with this version of OS X

So here's my current problem. I'm attempting to create a screensaver, all I'm doing is setting a background color like so,

public override func drawRect(rect: NSRect) {

    super.drawRect(rect)

    let color = NSColor(red:0.33, green:0.78, blue:0.99, alpha:1)

    color.setFill()
    NSBezierPath.fillRect(rect)

}

Fairly straight forward. I also set EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;

Now when I go to install the .saver file I am returned with a message that says

You cannot use the screensaver X with this version of OS X

Any ideas?

like image 813
Idris Avatar asked Oct 28 '15 20:10

Idris


People also ask

Why won't my screensaver work on my Mac?

Update macOS to the Latest Version Buggy system software is a major reason preventing the screensaver from starting or working correctly on Mac. For example, the initial release of macOS Monterey had a known issue that stopped customizable screensavers from loading images from the photo library.

Why does my Mac screen go black instead of screensaver?

Your computer or display may have gone to sleep To save energy, your Mac and display go to sleep automatically when they're not in use. You can set your Mac and display to sleep at different times. Because the display wakes up faster than the rest of the Mac, you should set it to go to sleep before the Mac.


1 Answers

If you're on Mojave, then the Principal class needs to include the module name (target name) as well:

<key>NSPrincipalClass</key>
<string>[YourTarget].[YourClass]</string>

You might also need to set Always Embed Swift Standard Libraries to YES in your Build Settings as well as check the Principle Class as above.

Sources:

https://github.com/JohnCoates/Aerial/issues/464 https://blog.viacom.tech/2016/06/27/making-a-macos-screen-saver-in-swift-with-scenekit/

like image 190
svarrall Avatar answered Sep 29 '22 14:09

svarrall