Google Material Design Ripple Effects for Swift project. This project is inspired from Android Material Design Ripple Effects.
- Easy way to use Ripple Effects.
- Call
rippleAnimateto yourUIViewinstances with RippleConfiguration. rippleAnimateisUIViewextension.
First, you should import RippleAnimation module.
import RippleAnimationAnd now, you can call rippleAnimate with UIView.RippleConfiguration instance.
@IBAction func pressed(sender: UIButton) {
let config = UIView.RippleConfiguration(color: UIColor.alizarin())
sender.rippleAnimate(with: config, completionHandler: {
print("ripple!!")
})
}You can use rippleAnimate with more detail parameters with RippleConfiguration just like below.
@IBAction func pressed(sender: UIButton) {
var config = UIView.RippleConfiguration(color: UIColor.alizarin())
config.clipsToBounds = true
config.scaleAnimateDuration = 0.3
config.fadeAnimateDuration = 0.1
sender.rippleAnimate(with: config, completionHandler: {
print("ripple!!")
})
}More details is written in Demo project.
- iOS9.3 or later
- Xcode8 - Swift3
To install RippleAnimation with CocoaPods, add the following lines in your Podfile and run pod install.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
pod ‘RippleAnimation’, ‘0.3’To Install RippleAnimation with Carthage, write github "mnat44/RippleAnimation" in your Cartfile and run carthage update.
RippleAnimation is released under the MIT license. Go read the LICENSE file for more information.
