UIWindow及程序启动的过程
1. UIWindow才有自发显示的功能, 一个程序之所以能显示东西,是因为有window !// [self.window makeKeyAndVisible];
2. 任何view的显示,都要添加到UIWindow上(控制器的view要依赖于UIWindow才能显示)。
3. UIApplication最先知道旋转事件,UIApplication会将旋转事件发给窗口UIWindow, UIWindow再将事件传给它的控制器。一个view要不要转,取决于控制器有没有旋转。
// 旋转事件 -----> UIApplication -----> UIWindow --->rootViewController
4. 如果有不同控制器的view要显示在窗口UIWindow上,那在需要显示某一个控制器的时候将控制器的view显示到UIWindow上即可。
5. 加载main storyboard的时候会自动创建一个UIWindow对象,并且让箭头所指的控制器成为window的根控制器。
6. 看控制器相关的官方文档:
Documentation ----> cocoa touch ---> UIKit -----> View Controller Programming
7. 程序启动的完整过程:
8. 四大对象关系图:
9. UIWindow的获得:
10. 键盘也是在某一个UIWindow中,如果要改键盘上的按钮:
首先要拿到键盘所在的window ---> 在window中拿到子控件 (键盘) -----> 改键盘中的按钮。
UIWindow及程序启动的过程的更多相关文章
- iOS程序启动的过程及原理
iOS程序启动的过程及原理 文字部分 先执行main函数,main内部会调用UIApplicationMain函数 UIApplicationMain函数里面做了什么事情??? 1> 创建UIA ...
- IOS程序启动的过程
IOS程序启动按照以下5个步骤执行 1.main函数 IOS程序启动首先执行main函数 2.UIApplicationMain 执行main函数中的UIApplicationMain函数,这个函数会 ...
- iOS app 程序启动原理
iOS app 程序启动原理 Info.plist: 常见设置 建立一个工程后,会在Supporting files文件夹下看到一个"工程名-Info.plist"的文件, ...
- iOS开发——UI进阶篇(七)程序启动原理、打电话、发短信
一.Info.plist常见的设置 1.建立一个工程后,会在Supporting files文件夹下看到一个“工程名-Info.plist”的文件,该文件对工程做一些运行期的配置,非常重要,不能删除 ...
- IOS程序启动原理
1.Info.plist 建立一个工程后,会在Supporting files文件夹下看到一个“工程名-Info.plist”的文件,该文件对工程做一些运行期的配置,非常重要,不能删除 常见属性(红色 ...
- UIPickerView/UIDatePicker/程序启动的完整过程
一.UIPickerView 1.UIPickerView的常见属性 数据源(用来告诉UIPickerView有多少列多少行) @property(nonatomic,assign) id<UI ...
- iOS程序启动过程
First, the function creates the main application object (step 3 in the flowchart). If you specify ni ...
- Android应用程序内部启动Activity过程(startActivity)的源代码分析
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6703247 上文介绍了Android应用程序的 ...
- Android应用程序启动过程源代码分析
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6689748 前文简要介绍了Android应用程 ...
随机推荐
- clang -O3 for循环的LLVM IR
O3都是怪物,这里分析的是CLANG怪物,示例程序遍历数组每个元素然后放大. void foreach_scale(int arr[],int elem){ for(int i=0;i<elem ...
- POI生成Excel强制换行
自动换行的设置: HSSFCellStyle cellStyle=workbook.createCellStyle(); cellStyle.setWrapText(true); cell.setCe ...
- 11.Find All Numbers Disappeared in an Array(找出数组中缺失的数)
Level: Easy 题目描述: Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements ...
- Android----获取包名和sh1
第一种:使用java的一个工具---keytool工具(jdk目录下) SHA1叫安全哈希算法用于签名 keytool -list -v -keystore 签名证书所在位置path 第二种:通过An ...
- Experimental Educational Round: VolBIT Formulas Blitz A
Description The HR manager was disappointed again. The last applicant failed the interview the same ...
- Educational Codeforces Round 7 A
Description Consider the infinite sequence of integers: 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5. ...
- management & Actuator
self define indicator https://docs.spring.io/spring-boot/docs/current/reference/html/production-read ...
- navicat premiun连接mysql数据库报错,错误代码:1251
今天在电脑上安装了Mysql 8.0.11,然后想用 Navicat Premium连接数据库,结果报错了: error 1251:client does not support authentica ...
- 用HTMLParser解析html时报错:No module named 'htmlentitydefs'
python3.6用HTMLParser解析html时报错 No module named 'htmlentitydefs'或No module named 'markupbase' 先上代码 fro ...
- Android 中怎么重新启动APP或系统
重新启动应用程序,有两种方法,分别是: 1.通过ActivityManager来重新启动应用程序: ActivityManager manager = (ActivityManager)this.ge ...