iOS開發(fā)者皆知的十大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的最基本的基類最筒,當(dāng)一個view要顯示或者消失的時候哩罪,UIViewController有相應(yīng)方法會被調(diào)用拳球。子類可以重寫loadView方法去創(chuàng)建他們自定義的view,或者指定一個nib被自動加載實(shí)現(xiàn)赴肚。這個類也是對于代理,數(shù)據(jù)源協(xié)議方法和一些其他控制器的方法展示實(shí)現(xiàn)一個很好的空間地方已亥。

2.Navigation Controller

一個控制器管理導(dǎo)航層次結(jié)構(gòu)

繼承自:UIView : UIResponder : NSObject

作用:UINavigationController管理一堆視圖控制器,每個代表一個視圖的信息,比如它的標(biāo)題和與視圖相關(guān)的導(dǎo)航項(xiàng)采蚀。當(dāng)視圖控制器推到和從棧中彈出,導(dǎo)航控制器更新適當(dāng)?shù)膶?dǎo)航欄和視圖疲牵。

3.Table View Controller

一個表格視圖控制器管理。

繼承自:UIViewController : UIResponder : NSObject

作用:UItableViewController創(chuàng)建一個控制器對象,管理一個表格(UItableView)視圖榆鼠。

4.Collection View Controller

一個集合視圖控制器管理纲爸。

繼承自:UIViewController : UIResponder : NSObject

作用:UICollectionViewController代表一個視圖控制器由一個集合視圖組成的內(nèi)容。

5.Tab Bar Controller

控制器管理一組視圖控制器代表標(biāo)簽欄項(xiàng)目璧眠。

繼承自:UIViewController : UIResponder : NSObject

作用:UITabBarController實(shí)現(xiàn)了一個專門的視圖控制器管理radio-style選擇界面缩焦。這個標(biāo)簽欄界面顯示窗口底部的標(biāo)簽之間的選擇不同的模式和顯示的視圖模式。

6.Split View Controller

一個復(fù)合視圖控制器管理左和右視圖控制器责静。

繼承自:UIViewController : UIResponder : NSObject

作用:UISplitViewController一個容器視圖控制器,提出了一種主從復(fù)合結(jié)構(gòu)的界面袁滥。在一個主從復(fù)合結(jié)構(gòu)的界面,主要視圖控制器的變化(主)驅(qū)動器改變第二個視圖控制器(細(xì)節(jié))。這兩個視圖控制器可以安排他們并排,一次只有一個是可見的,或者這只是部分隱藏了另一個灾螃。在iOS 8之后,您可以使用UISplitViewController類所有iOS設(shè)備;在早期版本的iOS,該類只能在iPad上用题翻。

7.Page View Controller

呈現(xiàn)一系列的頁面視圖控制器。

繼承自:UIViewController : UIResponder : NSObject

作用:UIPageViewController讓用戶在頁面之間導(dǎo)航的內(nèi)容,每一頁都由自己的視圖控制器管理對象腰鬼。導(dǎo)航可以由應(yīng)用程序以編程的方式控制或由用戶直接使用手勢嵌赠。當(dāng)導(dǎo)航頁面,頁面視圖控制器使用你指定的過渡動畫改變。

8.GLKit View Controller

一個控制器管理GLKit視圖熄赡。

繼承自:UIViewController : UIResponder : NSObject

作用:GLKViewController提供了所有的標(biāo)準(zhǔn)視圖控制器的功能,但另外實(shí)現(xiàn)一個OpenGL ES呈現(xiàn)循環(huán)姜挺。GLKViewController對象結(jié)合GLKView工作對象在視圖中顯示幀的動畫。

9.AVKit Player View Controller

一個視圖控制器管理AVPlayer對象彼硫。

繼承自:UIViewController : UIResponder : NSObject

作用:AVPlayerViewController顯示的視頻內(nèi)容AVPlayer對象與系統(tǒng)提供的播放控制炊豪。

10.Search Bar and Search Display Controller

搜索顯示控制器管理顯示搜索欄和表視圖顯示一個搜索的結(jié)果數(shù)據(jù)管理的另一個視圖控制器。

繼承自:UIViewController : UIResponder : NSObject

作用:UISearchController專門為UITableView搜索封裝的一個類拧篮。

總述

作為一個iOS開發(fā)者词渤,不但要會用iOS開發(fā)的各種控件,可能還需要了解一些專業(yè)性的術(shù)語串绩,也就是很多公司在招聘的時候會有一些奇葩的面試題缺虐,往往大多面試題就包含了這些。所以礁凡,閑時高氮,多了解一點(diǎn),何嘗不可把篓。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末纫溃,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子韧掩,更是在濱河造成了極大的恐慌紊浩,老刑警劉巖,帶你破解...
    沈念sama閱讀 222,681評論 6 517
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異坊谁,居然都是意外死亡费彼,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 95,205評論 3 399
  • 文/潘曉璐 我一進(jìn)店門口芍,熙熙樓的掌柜王于貴愁眉苦臉地迎上來箍铲,“玉大人,你說我怎么就攤上這事鬓椭〉吆铮” “怎么了?”我有些...
    開封第一講書人閱讀 169,421評論 0 362
  • 文/不壞的土叔 我叫張陵小染,是天一觀的道長翘瓮。 經(jīng)常有香客問我,道長裤翩,這世上最難降的妖魔是什么资盅? 我笑而不...
    開封第一講書人閱讀 60,114評論 1 300
  • 正文 為了忘掉前任,我火速辦了婚禮踊赠,結(jié)果婚禮上呵扛,老公的妹妹穿的比我還像新娘。我一直安慰自己筐带,他們只是感情好今穿,可當(dāng)我...
    茶點(diǎn)故事閱讀 69,116評論 6 398
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著伦籍,像睡著了一般荣赶。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上鸽斟,一...
    開封第一講書人閱讀 52,713評論 1 312
  • 那天,我揣著相機(jī)與錄音利诺,去河邊找鬼富蓄。 笑死,一個胖子當(dāng)著我的面吹牛慢逾,可吹牛的內(nèi)容都是我干的立倍。 我是一名探鬼主播,決...
    沈念sama閱讀 41,170評論 3 422
  • 文/蒼蘭香墨 我猛地睜開眼侣滩,長吁一口氣:“原來是場噩夢啊……” “哼口注!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起君珠,我...
    開封第一講書人閱讀 40,116評論 0 277
  • 序言:老撾萬榮一對情侶失蹤寝志,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體材部,經(jīng)...
    沈念sama閱讀 46,651評論 1 320
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡毫缆,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,714評論 3 342
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了乐导。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片苦丁。...
    茶點(diǎn)故事閱讀 40,865評論 1 353
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖物臂,靈堂內(nèi)的尸體忽然破棺而出旺拉,到底是詐尸還是另有隱情,我是刑警寧澤棵磷,帶...
    沈念sama閱讀 36,527評論 5 351
  • 正文 年R本政府宣布蛾狗,位于F島的核電站,受9級特大地震影響泽本,放射性物質(zhì)發(fā)生泄漏淘太。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 42,211評論 3 336
  • 文/蒙蒙 一规丽、第九天 我趴在偏房一處隱蔽的房頂上張望蒲牧。 院中可真熱鬧,春花似錦赌莺、人聲如沸冰抢。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,699評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽挎扰。三九已至,卻和暖如春巢音,著一層夾襖步出監(jiān)牢的瞬間遵倦,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,814評論 1 274
  • 我被黑心中介騙來泰國打工官撼, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留梧躺,地道東北人。 一個月前我還...
    沈念sama閱讀 49,299評論 3 379
  • 正文 我出身青樓傲绣,卻偏偏與公主長得像掠哥,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子秃诵,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,870評論 2 361

推薦閱讀更多精彩內(nèi)容

  • /* UIViewController is a generic controller base class th...
    DanDanC閱讀 1,823評論 0 2
  • Swift版本點(diǎn)擊這里歡迎加入QQ群交流: 594119878最新更新日期:18-09-17 About A cu...
    ylgwhyh閱讀 25,427評論 7 249
  • *面試心聲:其實(shí)這些題本人都沒怎么背,但是在上海 兩周半 面了大約10家 收到差不多3個offer,總結(jié)起來就是把...
    Dove_iOS閱讀 27,167評論 30 470
  • 喜歡在這樣一個陰陰的下雨天彪杉,把車停在湖邊,聽聽電臺的音樂榛了,看看前面飄著雨的湖在讶。 今天,雨還沒有下起來霜大,天氣卻是涼涼...
    珺二爺閱讀 368評論 0 2
  • 最近又學(xué)習(xí)和研讀了幾本靈性書籍构哺,其中讓我感悟較深和最有話想說的是《告別娑婆》和《零極限》。 《告別娑婆...
    利一眾生閱讀 888評論 0 1