iOS开发者皆知的十大Controller

iOS UIViewController的种类和作用

Controller的9大种类

  1. View Controller - Provides view-management functionality for toolbars, navigation bars, and application views. The UIViewController class also supports modal views and rotating views when device orientation changes.
  2. Navigation Controller - Manages a stack of view controllers, each of which represents information about a view, such as its title and the navigation item associated with the view. When view controllers are pushed onto and popped off the stack, the navigation controller updates the navigation bar and view appropriately.
  3. Table View Controller - Manages a UITableView, automatically creating an instance with the correct dimensions and resizing mask, and acting as the table view’s delegate and data source. The UITableViewController class also provides toggling of editing modes.
  4. Collection View Controller - Manages a UICollectionView, automatically creating an instance with the correct dimensions and resizing mask, and acting as the collection view’s delegate and data source.
  5. Tab Bar Controller - Manages a set of view controllers, each of which represents a tab bar item. Each view controller provides information about its tab bar item and supplies the view to be displayed when the item is selected.
  6. Split View Controller - A composite view controller that manages left and right view controllers.
  7. Page View Controller - Presents a sequence of view controllers as pages, via coordination with a data source and delegate. Swipe navigation between the pages is automatically handled with a page curl transition that tracks the user’s finger. The navigation orientation can be horizontal, like pages in a book, or vertical, like pages in a wall calendar.
  8. GLKit View Controller - The GLKViewController class provides all of the standard view controller functionality, but additionally implements an OpenGL ES rendering loop. A GLKViewController object works in conjunction with a GLKView object to display frames of animation in the view.
  9. AVKit Player View Controller - A controller that manages an AVPlayer object, which can display audiovisual content and standard playback controls.
  10. Search Bar and Search Display Controller - The UISearchBar control provides a text field for entering text, a search button, a bookmark button, and a cancel button. The search display controller manages display of a search bar and a table view that displays the results of a search of data managed by another view controller. If the search bar is inserted into a view controller’s view, the appropriate connections to the search display controller will automatically be configured.
1.View Controller

一个视图控制器管理。

继承自:UIResponder : NSObject

作用:UIViewController管理一个view的最基本的基类,当一个view要显示或者消失的时候,UIViewController有相应方法会被调用。子类可以重写loadView方法去创建他们自定义的view,或者指定一个nib被自动加载实现。这个类也是对于代理,数据源协议方法和一些其他控制器的方法展示实现一个很好的空间地方。

2.Navigation Controller

一个控制器管理导航层次结构

继承自:UIView : UIResponder : NSObject

作用:UINavigationController管理一堆视图控制器,每个代表一个视图的信息,比如它的标题和与视图相关的导航项。当视图控制器推到和从栈中弹出,导航控制器更新适当的导航栏和视图。

3.Table View Controller

一个表格视图控制器管理。

继承自:UIViewController : UIResponder : NSObject

作用:UItableViewController创建一个控制器对象,管理一个表格(UItableView)视图。

4.Collection View Controller

一个集合视图控制器管理。

继承自:UIViewController : UIResponder : NSObject

作用:UICollectionViewController代表一个视图控制器由一个集合视图组成的内容。

5.Tab Bar Controller

控制器管理一组视图控制器代表标签栏项目。

继承自:UIViewController : UIResponder : NSObject

作用:UITabBarController实现了一个专门的视图控制器管理radio-style选择界面。这个标签栏界面显示窗口底部的标签之间的选择不同的模式和显示的视图模式。

6.Split View Controller

一个复合视图控制器管理左和右视图控制器。

继承自:UIViewController : UIResponder : NSObject

作用:UISplitViewController一个容器视图控制器,提出了一种主从复合结构的界面。在一个主从复合结构的界面,主要视图控制器的变化(主)驱动器改变第二个视图控制器(细节)。这两个视图控制器可以安排他们并排,一次只有一个是可见的,或者这只是部分隐藏了另一个。在iOS 8之后,您可以使用UISplitViewController类所有iOS设备;在早期版本的iOS,该类只能在iPad上用。

7.Page View Controller

呈现一系列的页面视图控制器。

继承自:UIViewController : UIResponder : NSObject

作用:UIPageViewController让用户在页面之间导航的内容,每一页都由自己的视图控制器管理对象。导航可以由应用程序以编程的方式控制或由用户直接使用手势。当导航页面,页面视图控制器使用你指定的过渡动画改变。

8.GLKit View Controller

一个控制器管理GLKit视图。

继承自:UIViewController : UIResponder : NSObject

作用:GLKViewController提供了所有的标准视图控制器的功能,但另外实现一个OpenGL ES呈现循环。GLKViewController对象结合GLKView工作对象在视图中显示帧的动画。

9.AVKit Player View Controller

一个视图控制器管理AVPlayer对象。

继承自:UIViewController : UIResponder : NSObject

作用:AVPlayerViewController显示的视频内容AVPlayer对象与系统提供的播放控制。

10.Search Bar and Search Display Controller

搜索显示控制器管理显示搜索栏和表视图显示一个搜索的结果数据管理的另一个视图控制器。

继承自:UIViewController : UIResponder : NSObject

作用:UISearchController专门为UITableView搜索封装的一个类。

总述

作为一个iOS开发者,不但要会用iOS开发的各种控件,可能还需要了解一些专业性的术语,也就是很多公司在招聘的时候会有一些奇葩的面试题,往往大多面试题就包含了这些。所以,闲时,多了解一点,何尝不可。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值