Lazy pop and dismiss like in the Facebook, Instagram or Twitter apps.
A simple framework that allows you to create similar lazy pops and dismisses like in the Facebook, Instagram or Twitter apps.
Add the following line to your PodFile:
pod 'LazyTransitions'
Add the following line to your Cartfile
github "serp1412/LazyTransitions"
Here's the simplest way to use LazyTransitions
import LazyTransitions
func viewDidLoad() {
becomeLazy(for: .dismiss) // or .pop if have pushed this screen
}
view
property. But you can add transition triggers (i.e. panning on them will also trigger a transition) for other views in your screenaddTransition(forView: view)
// or
addTransition(forScrollView: scrollView)
Here's some sample code on how to use LazyTransitions in your project.
import LazyTransitions
class LazyViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
becomeLazy(for: .dismiss)
}
}
That's it! 😜
If you want to find out about more use cases for LazyTransitions
or just mess around with it a bit.
LazyTransitions.playground
fileREADME
playground page and follow the instructions inside.I hope you enjoy using this framework as much as I did creating it 😊