【UIKit-125-1】#import <UIKit/UIViewController.h>

来源:互联网 发布:最美乡村网络评选活动 编辑:程序博客网 时间:2024/05/23 15:39



UIKIT_EXTERN NSString *const UIViewControllerShowDetailTargetDidChangeNotificationNS_AVAILABLE_IOS(8_0);


interface UIViewController : UIResponder <NSCoding, UIAppearanceContainer, UITraitEnvironment, UIContentContainer>


【视图生命周期】

- (void)loadView; 1

- (void)viewDidLoad; 2

- (void)viewWillAppear:(BOOL)animated;  3

- (void)viewWillLayoutSubviews;4

- (void)viewDidLayoutSubviews;5

- (void)viewDidAppear:(BOOL)animated;    

- (void)viewWillDisappear:(BOOL)animated;7

- (void)viewDidDisappear:(BOOL)animated;  8

- (void)didReceiveMemoryWarning; 9


- (BOOL)isViewLoaded;判断是否viewloaded

- (void)loadView{    [super loadView];    JLOGSTR(@"loadView");    }- (void)viewDidLoad{    [super viewDidLoad];    JLOGSTR(@"viewDidLoad")}- (void)viewWillAppear:(BOOL)animated{    [super viewWillAppear:YES];    JLOGSTR(@"viewWillAppear")}- (void)viewWillLayoutSubviews{    [super viewWillLayoutSubviews];    JLOGSTR(@"viewWillLayoutSubviews")    }- (void)viewDidLayoutSubviews{    [super viewDidLayoutSubviews];    JLOGSTR(@"viewDidLayoutSubviews")    }- (void)viewDidAppear:(BOOL)animated{    [super viewDidAppear:YES];    JLOGSTR(@"viewDidAppear")}- (void)viewWillDisappear:(BOOL)animated{    [super viewWillDisappear:YES];    JLOGSTR(@"viewWillDisappear")}- (void)viewDidDisappear:(BOOL)animated{    [super viewDidDisappear:YES];    JLOGSTR(@"viewDidDisappear")}- (void)didReceiveMemoryWarning{    [super didReceiveMemoryWarning];    JLOGSTR(@"didReceiveMemoryWarning")}



@property(nonatomic,copyNSString *title; //控制器取个名字

@property(nonatomic,retainUIView *view;    //self.view超常用



xib storyboard相关】

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil;


@property(nonatomic,readonly, copy)NSString *nibName;    

@property(nonatomic,readonly, retain)NSBundle *nibBundle; 

@property(nonatomic, readonly, retain) UIStoryboard *storyboard;



- (void)performSegueWithIdentifier:(NSString *)identifier sender:(id)senderNS_AVAILABLE_IOS(5_0);

- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)senderNS_AVAILABLE_IOS(6_0); 

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)senderNS_AVAILABLE_IOS(5_0);


- (BOOL)canPerformUnwindSegueAction:(SEL)action fromViewController:(UIViewController *)fromViewController withSender:(id)senderNS_AVAILABLE_IOS(6_0);



- (UIViewController *)viewControllerForUnwindSegueAction:(SEL)action fromViewController:(UIViewController *)fromViewController withSender:(id)senderNS_AVAILABLE_IOS(6_0);


- (UIStoryboardSegue *)segueForUnwindingToViewController:(UIViewController *)toViewController fromViewController:(UIViewController *)fromViewController identifier:(NSString *)identifier NS_AVAILABLE_IOS(6_0);





@property(nonatomic,readonly)UIViewController *parentViewController;

@property(nonatomic,readonly)UIViewController *presentedViewController  NS_AVAILABLE_IOS(5_0);

@property(nonatomic,readonly)UIViewController *presentingViewController NS_AVAILABLE_IOS(5_0);



@property(nonatomic,assign)BOOL definesPresentationContext NS_AVAILABLE_IOS(5_0);


@property(nonatomic,assign)BOOL providesPresentationContextTransitionStyleNS_AVAILABLE_IOS(5_0);




- (BOOL)isBeingPresented NS_AVAILABLE_IOS(5_0);

- (BOOL)isBeingDismissed NS_AVAILABLE_IOS(5_0);


- (BOOL)isMovingToParentViewController NS_AVAILABLE_IOS(5_0);

- (BOOL)isMovingFromParentViewController NS_AVAILABLE_IOS(5_0);



【弹出视图控制器】

- (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completionNS_AVAILABLE_IOS(5_0);

- (void)dismissViewControllerAnimated: (BOOL)flag completion: (void (^)(void))completionNS_AVAILABLE_IOS(5_0);

@property(nonatomic,assign)UIModalTransitionStyle modalTransitionStyle NS_AVAILABLE_IOS(3_0);

@property(nonatomic,assign)UIModalPresentationStyle modalPresentationStyleNS_AVAILABLE_IOS(3_2);//ipad有效

@property(nonatomic,assign)BOOL modalPresentationCapturesStatusBarAppearanceNS_AVAILABLE_IOS(7_0);//同上

- (BOOL)disablesAutomaticKeyboardDismissal NS_AVAILABLE_IOS(4_3);

       NewViewController *nVC = [[NewViewController alloc]init];    //    nVC.modalTransitionStyle = UIModalTransitionStyleCoverVertical;        nVC.modalPresentationCapturesStatusBarAppearance = YES;    nVC.modalPresentationStyle = UIModalPresentationPopover;            [self presentViewController:nVC animated:YES completion:^{        NSLog(@"go");    }];        /*     typedef NS_ENUM(NSInteger, UIModalTransitionStyle) {     UIModalTransitionStyleCoverVertical = 0,     UIModalTransitionStyleFlipHorizontal,     UIModalTransitionStyleCrossDissolve,     UIModalTransitionStylePartialCurl NS_ENUM_AVAILABLE_IOS(3_2),     };          typedef NS_ENUM(NSInteger, UIModalPresentationStyle) {     UIModalPresentationFullScreen = 0,     UIModalPresentationPageSheet NS_ENUM_AVAILABLE_IOS(3_2),     UIModalPresentationFormSheet NS_ENUM_AVAILABLE_IOS(3_2),     UIModalPresentationCurrentContext NS_ENUM_AVAILABLE_IOS(3_2),     UIModalPresentationCustom NS_ENUM_AVAILABLE_IOS(7_0),     UIModalPresentationOverFullScreen NS_ENUM_AVAILABLE_IOS(8_0),     UIModalPresentationOverCurrentContext NS_ENUM_AVAILABLE_IOS(8_0),     UIModalPresentationPopover NS_ENUM_AVAILABLE_IOS(8_0),     UIModalPresentationNone NS_ENUM_AVAILABLE_IOS(7_0) = -1,     };     */            [self dismissViewControllerAnimated:YES completion:^{        NSLog(@"miss");    }];




【整个view的范围】

@property(nonatomic,assign)UIRectEdge edgesForExtendedLayout NS_AVAILABLE_IOS(7_0); //是否渗透到bar

@property(nonatomic,assign)BOOL extendedLayoutIncludesOpaqueBars NS_AVAILABLE_IOS(7_0); //是否渗透到状态栏

@property(nonatomic,assign)BOOL automaticallyAdjustsScrollViewInsets NS_AVAILABLE_IOS(7_0); //对于滚动视图设置NO有奇效。(滚动从bar之外开始,二又渗透到bar下面)

    self.edgesForExtendedLayout = UIRectEdgeTop;//到顶部,无视navigationBar,从(0.0)开始,不选top的会行44开始    self.extendedLayoutIncludesOpaqueBars = NO;    self.automaticallyAdjustsScrollViewInsets = NO;    /*     typedef NS_OPTIONS(NSUInteger, UIRectEdge) {     UIRectEdgeNone   = 0,     UIRectEdgeTop    = 1 << 0,     UIRectEdgeLeft   = 1 << 1,     UIRectEdgeBottom = 1 << 2,     UIRectEdgeRight  = 1 << 3,     UIRectEdgeAll    = UIRectEdgeTop | UIRectEdgeLeft | UIRectEdgeBottom | UIRectEdgeRight     } NS_ENUM_AVAILABLE_IOS(7_0);     */





@property (nonatomic)CGSize preferredContentSize NS_AVAILABLE_IOS(7_0);pad








- (UIStatusBarStyle)preferredStatusBarStyle NS_AVAILABLE_IOS(7_0); //设置重载样式

- (UIStatusBarAnimation)preferredStatusBarUpdateAnimationNS_AVAILABLE_IOS(7_0);//设置重载动画 

- (void)setNeedsStatusBarAppearanceUpdate NS_AVAILABLE_IOS(7_0);//执行改变。

    //plist中  View controller-based status bar appearance  -- NO;    [[UIApplication sharedApplication]setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];    [self setNeedsStatusBarAppearanceUpdate];//在VC中,执行改变状态栏    



@end



xx

0 0
原创粉丝点击