preface
This article does not have the profound content, mainly is usually write code encounter is not standard very disorderly, so write down mainly for memory, afraid of forgetting.
1. Controller and view writing
#pragma Mark-setup UI #pragma Mark-setup UI #pragma Mark-setup UI #pragma Mark-setup UI It is used in complex pages to cover all the controls that change, and is used in conjunction with stackView to control the display of the most basic state. #pragma mark-update UI // This module is bound to data and controls, remember, So this is the only thing that he does and he tries not to get mixed up in updateUI #pragma mark-bind model // data requests #pragma mark-request // various click methods #pragma mark-action // various agents and callbacks #pragma mark - delegateCopy the code
2, named
Simple things like class prefixes are not mentioned here. It’s basically a name for a common control and data type that I find interesting because OC is quite different from other languages. Finally, OC likes to have a type at the end, but many other languages don’t, and OC method names are more like one sentence, other languages are shorter. So, if I’m going to keep the tail of OC for personal code, but I’m going to abbreviate it, the variable name is too long. tableView : table tableViewCell : TVCell ViewController : VC Navigation : navi TabbarViewController : TabVC NSArray/NSMutableArray: arr NSDictory/NSMutableDictory: dict, etc