美文网首页
20161008 UIApplication、UIScreen、

20161008 UIApplication、UIScreen、

作者: Smicro | 来源:发表于2016-10-08 14:21 被阅读33次

UIApplication:

链接:UIApplication简介

(1)一个UIApplication对象就代表一个应用程序

(2)通过[UIApplication sharedApplication]可以获得UIApplication单例对象

(3) 一个iOS程序启动后创建的第一个对象就是UIApplication对象

(4)利用UIApplication对象,能进行一些应用级别的操作

初学者

链接:UIApplicationMain函数介绍(官方文档)

函数Discussion:

This function *1*instantiates the application object from the principal class and *2*instantiates the delegate (if any) from the given class and sets the delegate for the application. It also *3*sets up the main event loop, including the application’s run loop, and begins processing events. If the application’s Info.plist file specifies a main nib file to be loaded, by including the NSMainNibFile key and a valid nib file name for the value, this function loads that nib file.Despite the declared return type, this function never returns.

单词:

corresponding(相应的,匹配的)     despite(尽管)     declared(公布)     declaration(宣称)


UIScreen:

链接:UIScreen官方文档翻译

A UIScreen object defines the properties associated with a hardware-based display. iOS devices have a main screen and zero or more attached screens. A tvOS device has a main screen for the television connected to the device. Use this class to obtain screen objects for each display attached to the device. Each screen object defines the bounds rectangle for the associated display and other interesting properties such as its brightness.

overview:

*1*Prior to iOS 8, a screen’s bounds rectangle always reflected the screen dimensions relative to a portrait-up orientation. Rotating the device to a landscape or upside-down orientation did not change the bounds. *2*In iOS 8 and later, a screen’s bounds property takes the interface orientation of the screen into account. This behavior means that the bounds for a device in a portrait orientation may not be the same as the bounds for the device in a landscape orientation. Apps that rely on the screen dimensions can use the object in the fixedCoordinateSpace property as a fixed point of reference for any calculations they must make.

fixedCoordinateSpace:The fixed coordinate space of the screen.

单词:

associated with...(和...相关)     prior to...(在...之前)     dimensions(尺寸)     reflect(反映、反射)     portrait-up orientation(肖像/正面朝上方向)     in a landscape orientation(横向)     take ... into account(考虑...)     coordinate(坐标)     fixed(修正的)  

iOS中主要利用UIScreen来获取物理屏幕尺寸和设置屏幕亮度:

CGRect rect = [[UIScreen mainScreen] bounds];

[[UIScreen mainScreen] setBrightness:0.5];


UIWindow:

链接:UIWindow简介      UIWindow简介2      官方文档

A UIWindow object *1*provides the backdrop for your app’s user interface and *2*provides important event-handling behaviors. Windows do not have any visual appearance of their own, but they are crucial to the presentation of your app’s views. Every view that appears onscreen is enclosed by a window, and each window is independent of the other windows in your app. Events received by your app are initially routed to the appropriate window object, which in turn forwards those events to the appropriate view. Windows work with your view controllers to implement orientation changes and to perform many other tasks that are fundamental to your app’s operation.

单词:

crucial(重要的)     enclose(附着的)      independent(独立的)      appropriate(适当的)     route(按路线发送)     fundamental(基础的)


相关文章

  • 20161008 UIApplication、UIScreen、

    UIApplication: 链接:UIApplication简介 (1)一个UIApplication对象就代表...

  • iOS 中的单例模式

    在iOS中有很多单例对象,比如UIApplication,UIScreen等等,那我们自己可以实现单例吗?答案是肯...

  • 通过 3 个简单的步骤测试使用了系统单例的 Swift 代码

    大多数为苹果的任何平台编写的应用程序都依赖基于单例的API。从UIScreen到UIApplication再到NS...

  • 20161008

    回到东营的第一天,昨天晚上回来晕车吐了两次,在车上难受的想死,告诉我以为很重要的人但他们并没有表示出关心,对于他,...

  • 20161008

    今天寒露 起风 降温 感觉得到冷 加衣 保暖 准备迎接冬天 来吧 寒冷 嘿嘿

  • 20161008

    上班第一天 适应中,加油 千万不要在拿工资的地方玩手机 上班才是占据你生活的大量时间,学习学习变为能量者

  • UIScreen

    UIScreen 一个UIScreen代表了一个显示屏,iOS设备至少有一个自身的主显示屏,同时也有可能外接其他的...

  • UIScreen类的介绍

    UIScreen类 摘要 最近无聊看了一下苹果的UIScreen类,发现好像除了使用[UIScreen mainS...

  • iOS 屏幕亮度调节

    设置屏幕亮度:UIScreen.h [[UIScreen mainScreen] setBrightness:0....

  • ios获取屏幕宽度和高度

    宽度:UIScreen mainScreen] bounds].size.width 高度:UIScreen ma...

网友评论

      本文标题:20161008 UIApplication、UIScreen、

      本文链接:https://www.haomeiwen.com/subject/yvluyttx.html