SJFullscreenPopGesture


项目主页    by: changsanjiang     Star:    Fork:     

SJFullscreenPopGesture

全屏返回手势. 适用于带有视频播放器的App.
Fullscreen pop gesture. An application with a video player is available.

天朝

https://juejin.im/post/5a150c166fb9a04524057832

Sample

功能

  • 全屏手势(兼容scrollView, 当scrollView.contentOffset.x==0时, 触发全屏手势).
  • 指定盲区, 在指定区域不触发全屏手势. 可指定Frame或者View.
  • 切换, 系统边缘手势与全屏手势切换.
  • 禁用, 可在某个页面禁用手势.

Use

pod 'SJFullscreenPopGesture'

如果好用, 兄弟, 给个 Star 吧.

Disable

// 如果想使用系统手势,可以像下面那样. 
// If you want to use the system gestures, you can do the same as below.
#import "UIViewController+SJVideoPlayerAdd.h"
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    // use system 
    self.navigationController.useNativeGesture = YES;
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    // use custom 
    self.navigationController.useNativeGesture = NO;
}

Fade Area

// 如果想某个区域不触发手势, 可以这样做.
// If you want an area to not trigger gestures, you can do the same as below.
#import "UIViewController+SJVideoPlayerAdd.h"
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.sj_fadeArea = @[@(_btn.frame), @(_view2.frame)];
    // or
    self.sj_fadeAreaViews = @[_btn, _view2];
}

相关文章