SWNavigationController 0.0.1

SWNavigationController 0.0.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
版本最后发布2015年1月

Christopher Wendel 维护。



  • 作者:
  • Chris Wendel

这是一个 UINavigationController 的子类及其相应的 UINavigationControllerDelegate,它实现了通过视图层次结构左右滑动来支持的嵌套功能。

安装

在您的 Podfile 中

pod 'SWNavigationController' 

或者关闭此仓库,并手动将 PodFiles 目录中的文件添加到您的项目中

功能

@property (nonatomic, strong, readonly) UIGestureRecognizer *interactivePushGestureRecognizer;

SWNavigationController 包含一个交互式推手势识别器,其行为与 UINavigationController 的现有交互式弹出手势识别器相反。当一个视图控制器从导航堆栈中删除后,它可以通过从屏幕右侧滑动将其拉回导航堆栈顶部。

默认情况下,交互式推送尝试模仿内置的交互 弹出。

@property (nonatomic, strong) Class pushAnimatedTransitioningClass;

可以将 pushAnimatedTransitioningClass 设置为覆盖 SWNavigationController 默认交互式推送过渡,该过渡是当从屏幕右侧拉取时默认使用的。此类必须实现协议 UIViewControllerAnimatedTransitioning

@property (nonatomic, strong) Class popAnimatedTransitioningClass;

可以将 popAnimatedTransitioningClass 设置为覆盖当从屏幕左侧拉取时 UINavigationController 的默认交互式弹出过渡。此类必须实现协议 UIViewControllerAnimatedTransitioning

特性

  • 使用 Storyboard 或编程方式轻松创建嵌套视图控制器
  • 默认的推送过渡,模仿 UINavigationController 的弹出过渡
  • 可自定义的推送和弹出过渡
  • 轻松启用和禁用将视图控制器拉回堆栈
  • iOS 7 及以上版本

用法

要使用 SWNavigationController,只需更改 UINavigationController 的类型即可

  • 您可以在 Storyboard 中做这个操作

  • 或者在 AppDelegate 中编程做这个操作
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    SWNavigationController *navController = [[SWNavigationController alloc] initWithRootViewController:rootViewController];

    [self.window setRootViewController:navController];

    return YES;
}

贡献

使用 Github issues 跟踪错误提示和功能请求。

联系

Chris Wendel

许可证

MIT