GithubHelp home page GithubHelp logo

swipeback's Introduction

SwipeBack

☔由于历史遗留问题把,部分滑动返回给禁止了。但是这是个很傻x的操作,如何快速使用侧滑,经过参考与思考,便有了SwipeBack

Feature

  1. iOS侧滑返回(类似Android系统返回)
  2. 自定义侧滑返回策略
  3. 快速添加侧滑返回功能

Usage

在你需要侧滑的Responder(viewController或view)中实现下面代码(也可以放基类中)

1. 实现协议SwipBackProtocol
2. self.backManager = [[SwipBackManager alloc]initResponder:self.view];   [self.backManager fakeCompile];
3. 实现代理swipBackAction,在此方法中实现返回的逻辑(等同点击按钮事件)
4. 如果一个页面在A情况可支持手势,在B情况不支持手势,可以用self.backManager.invalid = YES; Or NO 关闭或开启侧滑

注意,这里是关闭了系统的手势滑动功能

// 关闭 侧滑
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
	self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}

Sam

swipeBackDemoswipeBack

swipeback's People

Contributors

macrong avatar

Watchers

 avatar

swipeback's Issues

Web页面的返回问题?

1、web页面,因为h5内部可能存在自己的返回事件处理逻辑,需要客户端自动告诉h5要执行返回操作在处理

在web页面实现代理
要根据自己的业务逻辑来处理,如:

- (void)swipBackAction {
    ///特殊逻辑处理,告诉h5要执行返回了
    ///Todo

    if (self.webView canGoBack)  {
         [_webView goBack];
         return;
    }

   [self.webView closeWeb];
}

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.