Skip to content

addSubview and removeFromSuperview with animations! (not with autolayout though)

License

Notifications You must be signed in to change notification settings

almostintuitive/UIView-Motion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UIView helper category to add animation on addSubview & removeFromSuperView with one method. Uses facebook pop. Doesn't play well with AutoLayout.

Easy peasy.

[self.view addSubview:self.viewToAdd withAnimationType:MotionTypeSlideInFromLeft];

[self.view removeFromSuperViewWithAnimationType:MotionTypeSlideOutToLeft];

Optional delay, completionBlock parameters are also available.

Disclaimer: When using delay, the UIView won't be added/removed to/from the view hierarchy until the specified time. Don't even try to make it work with AutoLayout :)

Animation types

  • FadeIn

  • FadeOut

  • SlideInFromLeft

  • SlideInFromRight

  • SlideInFromTop

  • SlideInFromBottom

  • SlideInFromBottomAndFadeIn

  • SlideOutToLeft

  • SlideOutToRight

  • SlideOutToTop

  • SlideOutToBottom

  • ZoomIn

  • ZoomOut

Contributing

Pull requests are welcome!

License

UIView+Motion is released under a MIT License. See LICENSE file for details.

About

addSubview and removeFromSuperview with animations! (not with autolayout though)

Resources

License

Stars

Watchers

Forks

Packages

No packages published