问题描述
我一直在看示例代码,有时候苹果命名xib文件 ClassNameView
,有时候 ClassNameViewController
。 ClassName
始终是 UIViewController
或 UITableViewController
我不知道命名一个xib时使用什么约定。我认为View不是真正的 ViewController
,但好奇的是什么约定是或至少你的命名约定为xibs。 / p>
I've been looking at the sample code and sometimes Apple names xib files ClassNameView
and sometimes ClassNameViewController
. The ClassName
is always a UIViewController
or UITableViewController
, which had me wonder what convention to use when naming a xib. I would think View as it's not really the ViewController
, but curious on what the convention is or at least what your naming conventions are for xibs.
推荐答案
我使用ClassNameView,因为xib表示视图,而不是视图控制器。我不认为有一个公认的惯例。
I use ClassNameView since the xib represents the view, not the view controller. I don't think there is a generally accepted convention.
这篇关于xib的名称约定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!