作者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/m.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