How to make a macOS screen saver
4 months ago
- #macOS
- #Development
- #ScreenSaver
- macOS's screen saver system is buggy and difficult to work with.
- Screen savers are applications with a '.saver' extension.
- Xcode project setup involves subclassing ScreenSaverView and implementing key methods.
- Preferences sheet can be added for configuration using UserDefaults.
- Initial rendering should start in startAnimation, not setup.
- animateOneFrame is optional and may not be reliable due to macOS bugs.
- Fade-in effects can be implemented using CoreAnimation.
- Previewing and stopping behavior differs between real use and System Settings.
- Handling resumption requires managing multiple instances to avoid bugs.
- Screen savers should implement an idle timeout to exit unused processes.
- Testing and distributing screen savers involves manual steps and signing.
- Apple's screen saver framework is broken and poorly maintained.
- Community workarounds and templates exist but require ongoing maintenance.