FSPopGesture 0.0.1

FSPopGesture 0.0.1

booniez 维护。



  • 来源
  • booniez

FSPopGesture

CI Status Version License Platform

示例

使用 AOP 在 iOS14+ 系统风格中实现全屏弹出手势。

整体实现参照 FDFullscreenPopGesture

对外暴露的属性保持一致

public protocol PopGestureRecognizable: AnyObject {
    var interactivePopDisabled: Bool { get set }
    var prefersNavigationBarHidden: Bool { get set }
    var interactivePopMaxAllowedInitialDistanceToLeftEdge: CGFloat { get set }
    var willAppearInjectBlock: ((_ viewController: UIViewController, _ animated: Bool) -> Void)? { get set }

    func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool
}

使用方法

AOP,只需添加 2 个文件,无需进行任何设置,所有导航控制器将能够自动使用全屏弹出手势。

要禁用导航控制器的此弹出手势

navigationController?.fullscreenPopGestureRecognizer.isEnabled = false

要禁用视图控制器的此弹出手势

interactivePopDisabled = false

安装

FullScreenPopGesture 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod 'FSPopGesture'

作者

booniez, [email protected]

许可证

FullScreenPopGesture 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。