欢迎光临
我们一直在努力

HWPopController – 高度自定义弹窗

建站超值云服务器,限时71元/月

HWPopController - 高度自定义弹窗

项目介绍:

pop up your ViewController with custom size, position and animations.
github地址:https://github.com/HeathWang/HWPopController
通过UIViewController来编写弹窗,支持所有的UIViewController,支持转屏,提供默认动画效果,并可以高度自定义。
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.

CompatibilityiOS 8.0+, support Objective-C & Swift.InstallationHWPopController is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod ‘HWPopController’, ‘~> 1.0.5’How to use

  • Create you popup UIViewController.
    • import HWPopController framework
    • config contentSizeInPop and contentSizeInPopWhenLandscape(if you want to support landscape)

#import "HWPop1ViewController.h"#import <HWPopController/HWPop.h>@interface HWPop1ViewController ()@end@implementation HWPop1ViewController- (void)viewDidLoad {    [super viewDidLoad];    // Do any additional setup after loading the view.    self.contentSizeInPop = CGSizeMake(250, 300);    self.contentSizeInPopWhenLandscape = CGSizeMake(300, 200);    // build you pop view.}

  • Popup your viewControllerIf you want high custom your popup, init HWPopController. Then config the properties what you want.Please see `HWPopController.h`{    HWPop1ViewController *pop1ViewController = [HWPop1ViewController new];    HWPopController *popController = [[HWPopController alloc] initWithRootViewController:pop1ViewController];    // popView position    popController.popPosition = HWPopPositionTop;    [popController presentInViewController:self];}Quick popup, use the UIViewController category.HWPop1ViewController *pop1ViewController = [HWPop1ViewController new];[pop1ViewController popupWithPopType:HWPopTypeGrowIn dismissType:HWDismissTypeGrowOut dismissOnBackgroundTouch:YES];
  • Dismiss pop Use native api. [self dismissViewControllerAnimated:YES completion:^{        }];Get popController, then call popController dismiss api. [self.popController dismiss];

Pop UINavigationControllerIf 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

More details, pls see the Example.ExampleTo run the example project, clone the repo, and run pod install from the Example directory first.AuthorHeathWang, yishu.jay@gmail.comLicenseHWPopController is available under the MIT license. See the LICENSE file for more info.

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » HWPopController – 高度自定义弹窗
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址