作者whitefur (白毛)
看板MacDev
标题[闲聊] UICotrol variable的命名
时间Sun May 31 19:17:24 2015
UIControl变数命名有什麽建议的方式吗
例如
UIButton *addButton
UIView *filterView
在最後面加上class的名常还蛮常见的
我自己也是这样命名
但是像tableView跟collectionView的话大家也这样命名吗?
UICollectionView *backgroundPickerCollectionView
UITableView *photoListTableView
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.41.215.116
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MacDev/M.1433071046.A.CBE.html
1F:→ darktt: 只要是view的就是View结尾,viewController的就Controller 05/31 19:21
2F:→ darktt: 结尾 05/31 19:22
3F:→ darktt: 不过常常看到继承UIViewController的给我用View结尾 05/31 19:22
4F:→ darktt: 我自己还有一个特例,就是UITableViewCell或UICollection 05/31 19:23
5F:→ darktt: ViewCell的会用Cell结尾就是了 05/31 19:24
6F:推 neotek: 一个Controller里面只有一个table或collection的话 05/31 19:38
7F:→ neotek: 我都直接用tableView 或是 collectionView 05/31 19:38
8F:→ neotek: 才不用每次切换到不同controller都要找一下这边叫什麽名字 05/31 19:39
9F:推 BS0824: 如果ViewController前面名称太长,我会简称OOOOOVC比较好记 05/31 22:16
10F:推 jfang: 虽然Objective-C本身就习惯长命名,但以ViewController来说 06/07 18:19
11F:→ jfang: 我也习惯用VC当作结尾 06/07 18:19