Yesterday interview, was asked a code refactoring, directly stunned ...
Come back a little bit to see, the code refactoring has a little understanding ... is to let your own code has a better structure, more concise and easy to read it is a way to improve the quality of code it! Xcode provides several code refactoring capabilities, with rename (rename), Extract, Create superclass, move up, move down, and encapsulate.
To use: Right-click--refactor in the code area to bring up the refactoring feature. Rename is used to rename a class name, method name, property name, and so on, extract is used to convert a piece of code you write into a method, create superclass is used for creating a parent class of the current class, move up moves the method or instance variable to the parent class, and move Down is the opposite. Encapsulate function is when you select a variable, will automatically help you to generate a get, set method, but there is proporty after this seems to be useless.
Well, this is half an hour of learning results, referring to some of the great God's blog, if there is plagiarism please tell and forgive me this small white bar??!
NH iOS Code refactoring 1