My name is HeathWang, an iOS software engineer.
- 💻 I’m currently learning Swift, Python.
- 💭 Discuss about iOS development with me.
- ✉️ Contact me: click here
- 🎯 Coding, Reading.
HWPanModal presents controller from bottom and drag to dismiss, high customize. iOS13 default modalPresentationStyle. 任意形式的底部弹框动画;头条、知乎、抖音弹出评论效果;地图浮层,iOS13 present默认模态效果。
License: MIT License
My name is HeathWang, an iOS software engineer.
代理输出如下
scrollViewDidScroll:] 0.000000
scrollViewDidScroll:] 11.000000
scrollViewDidScroll:] 0.000000
scrollViewDidScroll:] 12.500000
scrollViewDidScroll:] 0.000000
scrollViewDidScroll:] 12.500000
scrollViewDidScroll:] 0.000000
scrollViewDidScroll:] 15.000000
scrollViewDidScroll:] 0.000000
scrollViewDidScroll:] 16.500000
scrollViewDidScroll:] 0.000000
scrollViewDidScroll:] 17.000000
scrollViewDidScroll:] 0.000000
可能什么原因造成的?
点击其他按钮手动dismiss怎么弄?
Describe the bug
使用Pod 导入 Pod Version:HWPanModal (0.6.7)
具体描述:在项目中使用弹不出来、但已经打印弹出完成。界面上没东西。。。
我的使用方法:
#import <HWPanModal/HWPanModal.h>
然后
[self presentPanModal:[CMDiscoveryFilterViewController new] completion:^{
NSLog(@"弹出完成");
}];
控制器代码:
#import "CMDiscoveryFilterViewController.h"
#import <HWPanModal/HWPanModal.h>
@interface CMDiscoveryFilterViewController ()<HWPanModalPresentable>
@end
@implementation CMDiscoveryFilterViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor colorWithRed:0.000 green:0.989 blue:0.935 alpha:1.00];
}
#pragma mark - HWPanModalPresentable
- (PanModalHeight)shortFormHeight {
if ([self isLandScape]) {
return [self longFormHeight];
}
return PanModalHeightMake(PanModalHeightTypeContent, 200.00001);
}
// 当转屏且为横屏时,为全屏幕模式。
- (CGFloat)topOffset {
if ([self isLandScape]) {
return 0;
} else {
return 40;
}
}
- (BOOL)anchorModalToLongForm {
return NO;
}
//- (HWPanModalShadow)contentShadow {
// return PanModalShadowMake([UIColor yellowColor], 10, CGSizeMake(0, 2), 1);
//}
- (UIViewAnimationOptions)transitionAnimationOptions {
return UIViewAnimationOptionCurveLinear;
}
- (BOOL)isLandScape {
if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeRight ||
[UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft) {
return YES;
}
return NO;
}
#ifdef DEBUG
- (void)dealloc {
NSLog(@"%s", __PRETTY_FUNCTION__);
}
#endif
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
反馈群加不进去提示已经过期、麻烦加个微信方便反馈、我的微信号:mokejie_com
键盘弹出来的情况下再弹出模态看不到内容,变成透明的
- (void)configureScrollViewInsets {
// when scrolling, return
if ([self.presentable panScrollable] && ![self.presentable panScrollable].isScrolling) {
UIScrollView *scrollView = [self.presentable panScrollable];
// 禁用scrollView indicator除非用户开始滑动scrollView
scrollView.showsVerticalScrollIndicator = NO;
scrollView.scrollEnabled = [self.presentable isPanScrollEnabled];
scrollView.scrollIndicatorInsets = [self.presentable scrollIndicatorInsets];
UIEdgeInsets insets1 = scrollView.contentInset;
insets1.bottom = self.presentedViewController.bottomLayoutGuide.length;
scrollView.contentInset = insets1;
if (@available(iOS 11.0, *)) {
scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
} else {
// Fallback on earlier versions
}
}
}
初始化时, 发现您更改了contentInset的值, 在适配iPhone X系列的手机时, 我设置了tableView的contentInset.bottom 为kSafeAreaBottom = 34, 但是这个方法给我改成了 0
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
问题1:聊天界面创建几条消息cell的时候,tableview scrollToRowAtIndexPath无法进行滑动
问题2:设置了panScrollable之后,拖拽panScrollable区域以外无法收起弹窗。如:头部标题View
设置了tableView.contentInset.top = 100
在向下拖拽的时候会contentInset.top会=0,导致界面异常
同时以下2个方法都试过,都不能解决问题
自定义导航栏页面使用这个去presentmodal一个弹框出来后,系统导航栏出现,页面整体下移;
0.3.6版本,当present一个uinavigationcontroller, 如何处理hwpancontainerView的edge返回手势与自己的uinavigationcontroller的全屏返回手势的冲突??
demo 不能运行 库里缺少kvo的
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
MJMineGiftListViewController *list=[[MJMineGiftListViewController alloc]init];
[self presentPanModal:list];
[list dismissViewControllerAnimated:NO completion:nil];
如题
在遇到输入法弹出的时候会挡住界面。
发生在统计开始时
| JIGUANG | D - [JIGUANGRequestSession] setViewStart name CXYStoreDetails_VC time 2020-04-21-10:14:23
崩溃处打印
(lldb) po self
warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available.
0x0000000117f459b0
我们App新增的需求添加极光统计, 未添加时一切正常, 商品详情和店铺都有分享
操作顺序 打开店铺分享 -> 关闭店铺分享 -> 打开商品分享 -> crash
操作顺序 打开商品分享 -> 关闭商品分享 -> 打开店铺分享 -> crash
因为有个界面有UIScrollView但是只想锁定高度不希望用户改变。
Describe the bug
1、已在 reloadData 之后调用了 hw_panModalSetNeedsLayoutUpdate
2、竖向滚动没有问题
3、设置为横向后 flowLayout 的 inset 设置不准,右滑会让 collectionView 归位到 0,左滑很难触发
我注意到,滑动触发的方法 HWPanModalPresentableHandler.m
另外,正常竖向滚动触发 trackScrolling
而横向滚动 总是触发 haltScrolling
Describe the bug
如果前面vc隐藏导航栏 模态到另一个vc 然后返回 会发现导航栏会跳动
Attempt to present <HWAlertViewController: 0x1049330a0> on <HWViewController: 0x104c0bfb0> which is already presenting (null)
你的demo里 alert , 我尝试连续弹两个, 会出现上述提示, 能不能处理一下两个alertView 或者presentVC 同时存在, 不知有什么好点的解决方案没
/**
该方法好像不生效。
目前有个界面不希望用户去滑动卡片。但是允许卡片外滑动收起。
你好,我想在tabbar的上方弹出,tabbar的item还需要能点击,有什么方法能实现?急,谢谢
Group-Nav-知乎评论能复现bug
操作流程
你好,我通过presentPanModal:
方法,modal 一个导航控制器,然后在viewWillAppear:
的时候隐藏导航栏,拖拽关闭的时候不能 dismiss 整个控制器,并且设置 shortFormHeight
无效,一出来就直接到顶部了。
iOS 12.2
继承HWPanModalContentView的自定义View,底部添加 UIVisualEffectView 不起磨玻璃作用
直接变为透明度的图层
Describe the bug
已实现部分的功能引入到pod当中,能不能通过原生的实现KVOController的相关依赖。
很棒, 很多可以学习的知识, 加油!
Hi all,
Congratulations for this amazing library!
I'm trying to integrate it in one of my personal projects but I'm having a small issue. Right now I'm presenting a view controller with a table view using the library (just like in your example project). I want to dismiss this view controller when selecting a table view cell, the view controller dismisses but for some reason this takes too much time (view controller dismisses approximately 5 seconds after selecting the cell and calling -dismissViewControllerAnimated:completion method). I did a quick test, I added a button to dismiss the view controller and it worked flawlessly, the only issue is on the table view. Also I think is important to state that I do not have any complex code running that could cause a slow performance. Am I doing something wrong? Do I need to set a more advance configuration?
Thanks!
我自己自定义的 push 没法实现全屏 push,希望能给一个解决方案。谢谢
panScrollable的滚动条请隐藏,触感反馈ipad闪退
Describe the bug
If I set the bottom content constraint to safe area (rather than superview, in that case everything works fine) and return PanModalHeight(type: .intrinsic, height: 0)
for longFormHeight
, I am able to drag the content up higher, leaving the gap at the bottom (which seems to be equal to safeAreaInsets.bottom).
To Reproduce
ShoppingCartViewController
with these changes: bgView.snp.makeConstraints { (maker) in
// maker.edges.equalTo(view)
maker.leading.equalToSuperview()
maker.trailing.equalToSuperview()
maker.top.equalToSuperview()
if #available(iOS 11.0, *) {
maker.bottom.equalTo(self.view.safeAreaLayoutGuide)
} else {
maker.bottom.equalToSuperview()
}
}
...
extension ShoppingCartViewController {
override func longFormHeight() -> PanModalHeight {
return PanModalHeight(type: .intrinsic, height: 0)
}
Expected behavior
Just like in .content
mode, I expect the viewcontroller will not move higher that it's intrinsic content size.
怎么实现底部可以点击
当 h 为 float 类型时,会出现滑动 contentView 就 dismiss 的问题
将 h 类型改为 integer 时,该问题消失
知乎评论这个效果里,如果点击用户头像,可以像知乎那样直接push到用户个人信息页吗?
之前的版本我是导入了 #import "UIViewController+LayoutHelper.h" 文件,
获取presentedVc 自己控制的, 我看现在没办法导入这个文件, 还有什么方式可以自己处理吗?
使用UITableView 滑动没有问题。
但是使用UIDatePicker,弹出和显示都没有问题;向下滑动时间选择时,会自动下滑关闭窗口,请问怎么解决???
override func longFormHeight() -> PanModalHeight {
return PanModalHeight(type: .contentIgnoringSafeArea, height: 380.0)
}
override func anchorModalToLongForm() -> Bool {
return true
}
override func panScrollable() -> UIScrollView? {
return nil
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.