ergunemr / BottomPopup

BottomPopup provides a popup-like presentation style to any view controller
MIT License
875 stars 88 forks source link

BottomPopup

BottomPopup provides a popup-like presentation style to any view controller

What does BottomPopup do?

It is a custom presentation style for view controllers to present any view controller with slide animation from bottom of the screen.

What does it look like ?

Actually depends on your view controller, a real world examples can be seen below;

|

How is it set up?

Using CocoaPods (Recommended)

Add below line to your Podfile;

pod 'BottomPopup'

Then you can install it with pod install command.

Manual

Download the project, just drag and drop classes under BottomPopupController file to your project.

How is it used?

After install, simply make your view controller subclass of BottomPopupViewController.

For navigation controllers, it works exactly in same way, make your navigation controller subclass of BottomPopupNavigationController.

Congratulations, your view controller is ready to show 🎉

Then you can present your controller with native presentViewController:animated:completion: method, bottom popup controller will handle rest.

Customization

Bottom popup comes with couple of customizable properties. Since your view controller subclass of BottomPopupViewController now, you can override following properties in your view controller to change behaviour;

Delegate

If you want to track popup lifecycle or current dismiss interaction percent, you can set popupDelegate;

popupVC.popupDelegate = self

Methods;

func bottomPopupViewLoaded()
func bottomPopupWillAppear()
func bottomPopupDidAppear()
func bottomPopupWillDismiss()
func bottomPopupDidDismiss()
func bottomPopupDismissInteractionPercentChanged(from oldValue: CGFloat, to newValue: CGFloat)

Questions or Advices

Just send me an email (ergunemr@gmail.com)