HWPopController
HWPopController can popup UIViewController with multiple animations, custom pop size in portrait / landscape screen. Popup position can be top/center/bottom. And you can define your own popup animations.
Features
- Support popup UIViewController.
- Support popup UINavigationController, dynamic change pop size when you push/pop.
- Support 12 kinds of pop & dismiss animations.
- Support define your own custom animation for pop & dismiss.
- Support popup at top/center/bottom, and use
positionOffset
to adjust x,y coordinates.
Compatibility
iOS 8.0+, support Objective-C & Swift.
Installation
HWPopController is available through CocoaPods. To install
it, simply add the following line to your Podfile:
How to use
-
Create you popup UIViewController.
- import HWPopController framework
- config
contentSizeInPop
andcontentSizeInPopWhenLandscape
(if you want to support landscape)
-
Popup your viewController
If you want high custom your popup, init HWPopController. Then config the properties what you want.
Please seeHWPopController.h
Quick popup, use the UIViewController category.
-
Dismiss pop
Use native api.Get popController, then call popController dismiss api.
Pop UINavigationController
If you want pop UINavigationController, and every stacked UIViewController contentSize is not same. You can use HWPopNavigationController
.
HWPopNavigationController
subclass UINavigationController
, you can inherit from HWPopNavigationController
, config contentSizeInPop as default contentSize.
When you push A Controller, then Push B Controller. A, B Controller should config contentSizeInPop if you need. If you have not config it, we will use NavigationController contentSizeInPop.
Relationship:
- UINavigationController
- HWPopNavigationController
- Your custom UINavigationController inherit from HWPopNavigationController
- HWPopNavigationController
More details, pls see the Example.
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Author
HeathWang, yishu.jay@gmail.com