A Swift UISwitch subclass that paints over the parent view with a custom color when turned on.
AnimatedSwitch is a Swift subclass of UISwitch that adds a material-design-like animation to iOS toggle switches. When turned on, it dynamically paints over the parent view with a customizable color and shape, such as a circle, star, or diamond, providing a visually engaging user interface element. It solves the problem of bland, standard UISwitch controls by offering rich, animated visual feedback.
iOS developers looking to enhance their app's user interface with animated, customizable toggle switches, particularly those using Storyboard or programmatic UI development in Swift.
Developers choose AnimatedSwitch for its easy integration, Interface Builder support, and flexible customization options, allowing for unique animations without complex implementation. It provides a polished alternative to standard UISwitch with minimal code.
UISwitch which paints over the parent view with the color in Swift.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports @IBDesignable and @IBInspectable, enabling visual configuration in Storyboard and XIB files without code, as shown in the README's Interface Builder screenshot.
Offers multiple predefined shapes (round, star, diamond) and support for custom UIBezierPath, allowing unique visual effects beyond standard switches.
Can be added programmatically or via drag-and-drop, with properties like color and animationDuration configurable in Interface Builder for quick implementation.
Provides animationDidStart and animationDidStop closures for executing custom actions during the animation sequence, enhancing interactivity control.
Installation requires manually copying the Swift file, lacking integration with CocoaPods, Carthage, or Swift Package Manager, which complicates updates and maintenance.
As a UISwitch subclass, it cannot be used directly in SwiftUI projects without additional wrapping code, limiting adoption in modern iOS development.
Some properties, such as custom shapes, can only be set in code (e.g., .Custom(UIBezierPath)), reducing visual design flexibility in Storyboard.