Twinkle
is a Swift and easy way to make any UIView in your iOS or tvOS app twinkle.
This library creates several CAEmitterLayers and animates them generating a sparkle effect.
Twinkle
is available and recommended for installation using the Cocoa dependency manager CocoaPods. You can also simply copy the Twinkle.swift
file into your Xcode project.
# CocoaPods
swift_version = "4.0"
pod "Twinkle", "~> 0.3.0"
# Carthage
github "piemonte/Twinkle" ~> 0.3.0
# SwiftPM
let package = Package(
dependencies: [
.Package(url: "https://github.com/piemonte/Twinkle", majorVersion: 0)
]
)
The sample project provides an example of how to integrate Twinkle
, otherwise you can follow this example.
import Twinkle
// using the UIView extension
let view: UIView = UIView(frame: CGRect(x: 0, y: 0, width: 150, height: 50))
self.view.addSubview(view)
view.twinkle()
// using the class func
Twinkle.twinkle(myView)
- Found a bug? Open an issue.
- Feature idea? Open an issue.
- Want to contribute? Submit a pull request.
Twinkle is available under the MIT license, see the LICENSE file for more information.