Skip to content

braginets/InteractiveDismiss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

[DEPRECEATED] Since iOS13 this is build-in feature

Simple Interactive Transitions using UIViewPropertyAnimator

Since iOS10 UIViewPropertyAnimator gives us an amazing tool to make UIView animations interactive. this project is simple experiment, feel free to extend and customize - it is very simple!

  1. Copy InteractiveDismissing class to your project
  2. Conform ypour modal viewciontroller to the InteractiveDismissing protocol
var animator: UIViewPropertyAnimator?
  1. Add UIPanGestureRecognizer to your view
let panGesture = UIPanGestureRecognizer(target: self, action: #selector(ModalViewController.didTrackPanGesture))
view.addGestureRecognizer(panGesture)
  1. In your gesture handler simply call:
dismissInteractively(with: sender) {
	self.dismiss(animated: false, completion: nil)
}
  1. Done.

About

Simple example of interactive view transition (dismiss modal screen) using UIViewPropertyAnimator

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages