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?
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.
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.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With