A lightweight Swift package for interactive spring animations on macOS and iOS using damped spring physics.
CocoaSprings is a Swift package that provides interactive spring animations for macOS and iOS applications. It simulates damped spring physics to create fluid, continuous animations for UI elements like layers, views, and windows, solving the problem of abrupt, disjointed motion in interactive interfaces.
iOS and macOS developers building applications with smooth, interactive animations, particularly those needing physics-based motion for UI components.
Developers choose CocoaSprings for its lightweight implementation of video-game-inspired spring physics, offering seamless motion continuity and easy integration with standard AppKit and UIKit components.
Interactive spring animations for macOS/iOS
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The package is minimal and focused solely on simulating damped spring animations, making it easy to integrate via SPM without adding unnecessary bloat.
SpringConfiguration allows precise control over speed and decay with angular frequency and damping ratio, enabling fine-tuned motion effects as shown in the demo gifs.
It works on both iOS and macOS, providing subclasses for CALayer, UIView, NSView, and NSWindow, ensuring consistency across Apple's UI frameworks.
Uses a well-documented video game camera smoothing algorithm, ensuring smooth and continuous motion even with abrupt updates, as highlighted in the README's inspiration.
For SpringMotionView, developers must manually handle Auto Layout updates via a closure, adding complexity compared to automatic constraint animations in modern SwiftUI.
The package only supports 2D plane animations, so it's not suitable for applications requiring 3D transformations or advanced physics simulations.
CocoaSprings is built for AppKit and UIKit, lacking native support for SwiftUI, which may limit its relevance in contemporary Apple development ecosystems.