Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

弹不出来 #47

Closed
greezi opened this issue Apr 2, 2020 · 3 comments
Closed

弹不出来 #47

greezi opened this issue Apr 2, 2020 · 3 comments

Comments

@greezi
Copy link

greezi commented Apr 2, 2020

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

@greezi
Copy link
Author

greezi commented Apr 2, 2020

可以弹出来了
我的项目中也有个ViewController的分类
并重写了下面这个方法

//适配iOS 13 全屏
- (UIModalPresentationStyle)modalPresentationStyle {
    return UIModalPresentationFullScreen;
}

@Da-Hui
Copy link

Da-Hui commented Apr 2, 2020

赞👍,我是因为BaseViewController里重写了present方法导致的弹不出来,看了你这个解决了

@HeathWang
Copy link
Owner

ok, 那这个我关闭了
@greezi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants