GithubHelp home page GithubHelp logo

wiittersimithyu / sjfullscreenpopgesture Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 2.54 MB

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

License: MIT License

Ruby 2.86% Objective-C 92.06% Shell 5.08%

sjfullscreenpopgesture's Introduction

SJFullscreenPopGesture

Fullscreen pop gesture. It is very suitable for the application of the video player.
全屏返回手势. 对带有视频播放器的App非常适用.

Use

pod 'SJFullscreenPopGesture'

Features

  • Fullscreen Pop Gesture. Gestures are perfectly handled in UIScrollView And UIPageViewController.
  • Fade Area. The specified area does not trigger gestures. It does not affect other ViewControllers.
  • Disable Gesture. Designate ViewController disable pop gesture. It does not affect other ViewControllers.

Example

Please wait for the example load, or download the project directly.

Disable

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

Fade Area

// 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)]; // 如果想某个区域不触发手势, 可以这样做.
}

Common 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

天朝

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

sjfullscreenpopgesture's People

Contributors

wiittersimithyu avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.