为什么 UIApplicationMain 函数被命名为 class 命名风格
Why the UIApplicationMain function is named as the class naming style
我第一次看到UIApplicationMain的时候还以为是class,因为名字的首字母是大写的。而在阅读文档时发现它是一个函数。 Apple 必须以 class 命名风格命名 UIApplicationMain 函数的任何特殊原因?
来自 Naming Functions 中
“Cocoa 的编码指南”(添加了重点):
Function names are formed like method names, but with a couple exceptions:
- They start with the same prefix that you use for classes and constants.
- The first letter of the word after the prefix is capitalised.
这里,UI
是UIKit框架的前缀。
我第一次看到UIApplicationMain的时候还以为是class,因为名字的首字母是大写的。而在阅读文档时发现它是一个函数。 Apple 必须以 class 命名风格命名 UIApplicationMain 函数的任何特殊原因?
来自 Naming Functions 中 “Cocoa 的编码指南”(添加了重点):
Function names are formed like method names, but with a couple exceptions:
- They start with the same prefix that you use for classes and constants.
- The first letter of the word after the prefix is capitalised.
这里,UI
是UIKit框架的前缀。