欢迎光临
我们一直在努力

Fullscreen Pop Gesture, 全屏返回手势.

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

Fullscreen Pop Gesture, 全屏返回手势.

项目介绍:

SJFullscreenPopGesture

全屏返回手势. 对带有视频播放器的App非常适用.

Use

pod 'SJFullscreenPopGesture'

特性

  • 全屏手势。手势在UIScrollView和UIPageViewController中完美处理.

  • 触发盲区。指定区域不触发手势。不会影响其他ViewControllers.

  • 禁用手势。指定ViewController禁用手势。不会影响其他ViewControllers.

示例

#import "UIViewController+SJVideoPlayerAdd.h"
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.sj_DisableGestures = YES; // 如果想在某个页面禁用全屏手势, 可以这样做. 不影响其他页面. 离开页面时, 也无需恢复.
}
// If you want an area to not trigger gestures, you can do the same as below. It does not affect other ViewControllers.
#import "UIViewController+SJVideoPlayerAdd.h"
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.sj_fadeAreaViews = @[_btn, _view2]; // 如果想某个区域不触发手势, 可以这样做.
    // or
    self.sj_fadeArea = @[@(_btn.frame), @(_view2.frame)]; // 如果想某个区域不触发手势, 可以这样做.
}

常用 Method

@interface UIViewController (SJVideoPlayerAdd)

/*!
 *  The specified area does not trigger gestures. It does not affect other ViewControllers.
 *  In the array is subview frame.
 *  @[@(self.label.frame)]
 *
 *  指定区域不触发手势. see `sj_fadeAreaViews` method
 **/
@property (nonatomic, strong, readwrite, nullable) NSArray<NSValue *> *sj_fadeArea;

/*!
 *  The specified area does not trigger gestures. It does not affect other ViewControllers.
 *  In the array is subview.
 *  @[@(self.label)]
 *
 *  指定区域不触发手势.
 **/
@property (nonatomic, strong, readwrite, nullable) NSArray<UIView *> *sj_fadeAreaViews;

/*!
 *  disable pop Gestures. default is NO. It does not affect other ViewControllers.
 *
 *  禁用全屏手势. 默认是 NO.
 **/
@property (nonatomic, assign, readwrite) BOOL sj_DisableGestures;


@property (nonatomic, copy, readwrite, nullable) void(^sj_viewWillBeginDragging)(__kindof UIViewController *vc);
@property (nonatomic, copy, readwrite, nullable) void(^sj_viewDidDrag)(__kindof UIViewController *vc);
@property (nonatomic, copy, readwrite, nullable) void(^sj_viewDidEndDragging)(__kindof UIViewController *vc);

@end

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