typedef NS_ENUM(NSInteger, UINavigationControllerOperation) {
UINavigationControllerOperationNone,
UINavigationControllerOperationPush,
UINavigationControllerOperationPop,
};
UIKIT_EXTERN const CGFloat UINavigationControllerHideShowBarDuration;
@class UIView, UINavigationBar, UINavigationItem, UIToolbar, UILayoutContainerView;
@protocol UINavigationControllerDelegate;
#pragma - mark - --
NS_CLASS_AVAILABLE_IOS(2_0) @interface UINavigationController : UIViewController
// 可以添加 navigationBarClass 或其子类,toolbarClass 也是一样的。
- (instancetype)initWithNavigationBarClass:(Class)navigationBarClass toolbarClass:(Class)toolbarClass NS_AVAILABLE_IOS(5_0);
// 初始化根控制器
- (id)initWithRootViewController:(UIViewController *)rootViewController;
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated; // 推到下一个界面
- (UIViewController *)popViewControllerAnimated:(BOOL)animated; // 返回上一个界面
- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated; // 返回到上几个界面,返回被推出的控制器的数组
- (NSArray *)popToRootViewControllerAnimated:(BOOL)animated; // 返回到根界面
// 栈顶控制器
@property(nonatomic,readonly,retain) UIViewController *topViewController;
// 当前可见视图所属的控制器
@property(nonatomic,readonly,retain) UIViewController *visibleViewController;
// 所有的栈里地控制器
@property(nonatomic,copy) NSArray *viewControllers;
- (void)setViewControllers:(NSArray *)viewControllers animated:(BOOL)animated NS_AVAILABLE_IOS(3_0);
// 隐藏导航条
@property(nonatomic,getter=isNavigationBarHidden) BOOL navigationBarHidden;
- (void)setNavigationBarHidden:(BOOL)hidden animated:(BOOL)animated;
@property(nonatomic,readonly) UINavigationBar *navigationBar;
// 工具条
@property(nonatomic,getter=isToolbarHidden) BOOL toolbarHidden NS_AVAILABLE_IOS(3_0);
- (void)setToolbarHidden:(BOOL)hidden animated:(BOOL)animated NS_AVAILABLE_IOS(3_0);
@property(nonatomic,readonly) UIToolbar *toolbar NS_AVAILABLE_IOS(3_0);
@property(nonatomic, assign) id<UINavigationControllerDelegate> delegate;
@property(nonatomic, readonly) UIGestureRecognizer *interactivePopGestureRecognizer NS_AVAILABLE_IOS(7_0);
@end
@protocol UIViewControllerInteractiveTransitioning;
@protocol UIViewControllerAnimatedTransitioning;
@protocol UINavigationControllerDelegate <NSObject>
@optional
// 将要显示某一个控制器
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
// 已经显示某一个控制器
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated;
// 支持的旋转方向
- (NSUInteger)navigationControllerSupportedInterfaceOrientations:(UINavigationController *)navigationController NS_AVAILABLE_IOS(7_0);
- (UIInterfaceOrientation)navigationControllerPreferredInterfaceOrientationForPresentation:(UINavigationController *)navigationController NS_AVAILABLE_IOS(7_0);
- (id <UIViewControllerInteractiveTransitioning>)navigationController:(UINavigationController *)navigationController
interactionControllerForAnimationController:(id <UIViewControllerAnimatedTransitioning>) animationController NS_AVAILABLE_IOS(7_0);
- (id <UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController
animationControllerForOperation:(UINavigationControllerOperation)operation
fromViewController:(UIViewController *)fromVC
toViewController:(UIViewController *)toVC NS_AVAILABLE_IOS(7_0);
@end
@interface UIViewController (UINavigationControllerItem)
// 导航条组件
@property(nonatomic,readonly,retain) UINavigationItem *navigationItem;
@property(nonatomic) BOOL hidesBottomBarWhenPushed;
@property(nonatomic,readonly,retain) UINavigationController *navigationController;
@end
@interface UIViewController (UINavigationControllerContextualToolbarItems)
@property (nonatomic, retain) NSArray *toolbarItems NS_AVAILABLE_IOS(3_0);
- (void)setToolbarItems:(NSArray *)toolbarItems animated:(BOOL)animated NS_AVAILABLE_IOS(3_0);
@end
UINavigationController.h
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 一、安装mosquitto1.4的时候使用make的时候报以下错误: mosquitto_internal.h:4...
- 首先保证你的Bridgind-Header.h文件的路径引用正确 检验该文件是否导入正确的方法:.h文件中不要im...