UIViewController全部API的学习。
标签:uiviewcontroller
/*
UIViewController is a generic controller base class that manages a view. It has methods that are called
when a view appears or disappears.
Subclasses can override -loadView to create their custom view hierarchy, or specify a nib name to be loaded
automatically. This class is also a good place for delegate & datasource methods, and other controller
stuff.
*/
@class UIView;
//1. UIViewController是管理一个view的最基本的基类,当一个view要显示或者消失的时候,UIViewController有相应方法会被调用。子类可以重写loadView方法去创建他们自定义的view,或者指定一个nib被自动加载实现。这个类也是对于代理,数据源协议方法和一些其他控制器的方法展示实现一个很好的空间地方。
@class UINavigationItem, UIBarButtonItem, UITabBarItem;
//2. UINavigationItem是放置在导航栏中的,包含.rightBarButtonItem,.leftBarButtonItem,titleView,而这三个按钮又可以归为UIBarButtonItem类,并通过它创建。UITabBarItem是分栏控制器底部切换item按钮。
@class UISearchDisplayController
//3. UISearchDisplayController是专门为UITableView搜索封装的一个类。
@class UIPopoverController;
//4.UIPopverController是IPad特有的类,不能在iphone上使用,它负责控制Popover视图。Popover是一种临时视图,它以“漂浮”的形式出现在视图里面。
@class UIStoryboard, UIStoryboardSegue;
//5. UIStoryboard是iOS5以后新增的内容,是以故事版的形式来展示界面之间的逻辑业务关系,前端开发目前有三种方式(纯代码,代码+xib,UIStoryboard),UIStoryboard为其中一种。而UIStoryboardSegue—————————————————————
@class UIScrollView
//6. UIScrollView在UIKit中是UIScrollView类,是容器类型的视图。它有三个子类—UITextView,UITableview和UICollectionView,它们在内容超出屏幕时提供水平或垂直滚动条。
@protocol UIViewControllerTransitionCoordinator;
//7.这就涉及到自定义viewController容器转场,iOS7引入的新特性自定义viewController转场。-----------
typedef NS_ENUM(NSInteger, UIModalTransitionStyle) {
UIModalTransitionStyleCoverVertical = 0,
UIModalTransitionStyleFlipHorizontal,
UIModalTransitionStyleCrossDissolve,
UIModalTransitionStylePartialCurl NS_ENUM_AVAILABLE_IOS(3_2),
};
//8.UIModalTransitionStyle是弹出模态ViewController时的四种动画风格,UIModalTransitionStyleCoverVertical是从底部滑入,UIModalTransitionStyleFlipHorizontal是水平翻转,UIModalTransitionStyleCrossDissolve是交叉溶解,UIModalTransitionStylePartialCurl是翻页效果。
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,
};
//9,UIModalPresentationStyle是弹出模态ViewController时弹出风格,UIModalPresentationFullScreen是弹出VC时,VC充满全屏,UIModalPresentationPageSheet是如果设备横屏,VC的显示方式则从横屏下方开始,UIModalPresentationFormSheet是VC显示都是从底部,宽度和屏幕宽度一样。UIModalPresentationCurrentContext是VC的弹出方式和VC父VC的弹出方式相同。.....UIModalPresentationNone测试时会崩溃,出错‘The specified modal presentation style doesn‘t have a corresponding presentation controller.‘-------------------------------
@protocol UIContentContainer <NSObject>
温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/70988.html