Skip to content

pgpt10/Custom-Animator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom-Animator

Custom View Controller Transitioner

It handles the presenting of a view controller with custom transitions.

Preview

Preview gif

Requirements

  • Swift 3.0
  • xcode 8

Features

  1. Transitions supported:

  2. Bottom

  3. Top

  4. Left

  5. Right

  6. Center

  7. Also the following properties of the presenting controller can be modified according to the requirement:

  8. Duration

  9. Size

  10. Screen Insets

  11. Transition Type

  12. Back Drop View (optional) : Greyish view between presenting controller and the presented controller. It is optional to use Back Drop View.

  13. Dismiss on background tap (optional) : If the presented controller size is less than tha screen size, it can be dismissed on the background tap as well.

How to use

To add custom animation to a controller to be presented (Eg. Controller), do the following

  1. Conform Controller to "UIViewControllerTransitioningDelegate" protocol

  2. Implement these methods of UIViewControllerTransitioningDelegate protocol: a) animationControllerForPresentedController b) animationControllerForDismissedController c) presentationControllerForPresentedViewController (optional) - For Back Drop View

  3. Set "transitioningDelegate" property of Controller to "self"

  4. Set "modalPresentationStyle" property of Controller to ".Custom"

Note:

Comments are included in the project files to better understanding of the flow.

About

Custom View Controller Transitioner

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages