Reference effective Objective 2.0 item use clear and consistent naming recommendations
1. Method Name: Apply the Hump nomenclature, methods name should be able to show how the method is doing, do not worry about the name process, because when used, Xcode will automatically complete
-If methods returns a value, the method name should indicate what the value
-Do not use abbreviations
-For Boolean property, plus is or has prefix
-Do not use the Get prefix
-The name should be easy to read, as much as a natural sentence
2. Class protocol Name:
Use camel-named (each logical breakpoint in the name has a size letter identifier), and add a prefix that should reflect the company or individual, or the app itself, the first letter should be capitalized in order to distinguish it from variables and method
such as Beddupmycustomclass
3. Classes, methods, protocols, and other naming should be consistent in app development
In fact, the Objective-c method, class, protocol, etc. of the multi-reference standard is named, and it will keep the same style for a long time.
4. Instance variable, the name of the property, shall indicate what the property is,
(unless it's clear what it is (like scores, it's obviously an array, you don't have to name it Scorearray)
If it is a uilabel, it should be named ***label, if it is uiimageview, it should be ***imageview.
?
Add prefix K for # define
For private methods (not the public API), add a prefix that distinguishes it from the public API (such as adding p, or p_ is good)
?
iOS Development Summary (A0)-Class, variable, enum, method naming conventions and good practices