登录 立即注册
金钱:

Code4App-iOS开发-iOS 开源代码库-iOS代码实例搜索-iOS特效示例-iOS代码例子下载-Code4App.com

HWPopController - 高度自定义弹窗

[复制链接]
来自: heathwang 分类: iOS精品源码 上传时间: 2019-7-9 13:43:59
Tag:

项目介绍:

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.

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:
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 viewController
    If 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 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



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
License
HWPopController is available under the MIT license. See the LICENSE file for more info.

相关源码推荐:

我来说两句
*滑动验证:
所有评论(44)
无限释囚 2019-7-10 09:42:48
感谢分享,code4app有你更精彩
回复
AlonMessi 2019-7-10 09:43:11
帮帮顶顶!!
回复
Yf8546 2019-7-10 09:43:16
虽不明,但觉厉...
回复
莫应有道 2019-7-10 09:43:26
我是来学习的
回复
编程是什么 2019-7-10 09:43:34
不错不错,楼主辛苦了。。。
回复
A7472 2019-7-10 09:44:16
膜拜大神~
回复
code4app热心网友 2019-7-10 14:00:16
我只是路过打酱油的。
回复
code4app热心网友 2019-7-10 14:40:45
很给力,Code4App有你更精彩!
回复
code4app热心网友 2019-7-10 15:41:16
学习学习!
回复
12345下一页
提取码:  下载次数:6 状态:已购或VIP 售价:0(原价:15)金钱 下载权限:初级码农 
233 0 6
联系我们
首页/微信公众账号投稿

帖子代码编辑/版权问题

QQ:435399051,742864542

如何获得代码达人称号?

代码贡献英雄榜
用户名 下载数
通过邮件订阅最新 Code4App 信息
上一条 /4 下一条
联系我们
关闭
合作电话:
13802416937
Email:
435399051@qq.com
商务市场合作/投稿
问题反馈及帮助
联系我们

广告投放| 广东互联网违法和不良信息举报中心|中国互联网举报中心|Github|申请友链|手机版|Code4App ( 粤ICP备15117877号-1 )

快速回复 返回顶部 返回列表