From the beginning of my junior year to start work, almost all are lonely development because around the development of iOS not much, in addition to learning the code of open source excellent style skills the rest is their own, so developed a lot of bad habits. Ben knows the benefits of object-oriented, but the actual development will always have a bad habit of piling code, just to solve the current problem, so Uiviewcontroller inside wrote a heap of some not, function point is realized, but did not give themselves back, often changed to lead a whole body, When the product prepares the high-Fidelity debugging UI when the headache says, "Your dynamic height is calculated, I do not know how to write together why not a sub-view of a model?"
So in 2015 for the first time Codereview I summed up the following several development programming ideas
I think this is my biggest progress since the development, has been in the "build", no one to tell you where you wrong, in fact, was put forward so many comments, I actually refused, because it is a kind of criticism. But when I began to develop a bright light, forcing lattice also instant ascension, write high-quality code of the program is the senior IT engineer is distinguished from the removal of brick workers. Up, girl, this is the progress of history, it will be brighter.
- There must be a space or a carriage return on both sides when applying to the logical operator.
- Method name as far as possible to understand the method function
- The method name must start with lowercase
- When it comes to writing Tableviewcell, it is not easy to change the simplest elements to modify the height of the calculation, especially when the dynamic height must be a separate module cell or a cell in a separate model UIView
- Initializes a tableviewcell to use the multiplexing mechanism T to improve efficiency this applies to unified mode if there is a change, it will be covered if not applicable
- When the UI loads data, the data is ready to be prepared as early as possible
- The UI interface is complex to be split into several branch UI interfaces written into the view model to avoid the modification process of holding a full body
- Dynamically modify the UI location and size. Frame to minimize the use of this particularly time-consuming and inefficient, change of opinion is replaced by Cgrectgetmaxx Cgrectgetmaxx cgrectgetwidth cgrectgetheight
- Methods to modify the whole concept of the changes in the local is of little significance, such as the symptoms of the order of the basic should be sorted should not be in the case of the application of the time to sort
IOS Code Style Habits Summary 1