Latest | 1.2.0 |
---|---|
Homepage | https://github.com/piaotairen/PopGesture |
License | MIT |
Platforms | ios 9.0 |
Frameworks | UIKit |
Authors |
侧滑手势返回,解决自定义导航栏无手势返回的问题。
使用
- Swift 4 中
initialze
方法被禁用,需在application(_:didFinishLaunchingWithOptions:)
方法中调用FullscreenPopGesture.configuration()
来启用 Method swizzling。
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// 启用
FullscreenPopGesture.configuration()
return true
}
- 跳转至有 UIScrollView 的控制器时,需要在 UIScrollView 内部完成返回手势,只需如下设置:
scrollView.scrollViewPopGestureRecognizerEnable = true
- 本库实现无代码全局设置侧滑返回,如需取消界面侧滑返回手势,则在该界面的视图控制器中添加如下代码:
override func viewDidLoad() {
super.viewDidLoad()
// 添加以禁用侧滑返回 仅该界面有效
interactivePopDisabled = true
}
CocoaPods 安装
pod 'FullscreenPopGesture'
Latest podspec
{ "name": "FullscreenPopGesture", "version": "1.2.0", "summary": "PopGesture for App which use a custom navigation bar.", "description": "PopGesture for App which use a custom navigation bar. We want to usengesture to pop viewController, sometime we do not set navigation bar nas system style. use PopGesture can solve your problems.", "homepage": "https://github.com/piaotairen/PopGesture", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "Cobb": "[email protected]" }, "platforms": { "ios": "9.0" }, "source": { "git": "https://github.com/piaotairen/PopGesture.git", "tag": "1.2.0" }, "source_files": [ "PopGesture/PopGesture", "PopGesture/PopGesture/**/*.{swift}" ], "exclude_files": "Classes/Exclude", "frameworks": "UIKit", "swift_version": "4.0" }
Thu, 08 Nov 2018 08:00:09 +0000