A simple transition with native ripple effect which is a combination between ripple and fade-out effect.
Xcode 9, Swift 4, iOS 8 or above
RippleTransition is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'RippleTransition'
First, you need to import the module.
import RippleTransition
class ViewController: UIViewController, UIViewControllerTransitioningDelegate {
let transition = RippleTransition()
func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return self.transition
}
func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
return self.transition
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let controller = segue.destination
controller.transitioningDelegate = self
}
}
Custom animation duration by
transition.transitionTimeInterval = 1.0
RippleTransition is available under the MIT license. See the LICENSE file for more info.