Writing annotations is an essential part of the iOS development process. This not only helps you review the code, but also improves the readability of the code, making it easy to maintain code. However, writing comments is a dull job. We wasted a lot of time in typing, in /* * */ such a character. Also, these character inputs are cumbersome. VVDocumenter-Xcode, freeing us from the boring character input.
What is Vvdocumenter-xcode
Vvdocumenter is a plugin that can help us quickly generate a comment template. As long as we enter before the method that needs to be annotated /// , the comments are automatically generated and the individual parameters and return values are extracted. We only need to fill in the placeholder content to complete the comment writing. Give me a picture and feel it. By the way, Vvdocumenter also supports Swift. Last week, China's first Swift conference was successfully held. I believe that there will be a swift learning craze in China.
Installing and using Vvdocumenter-xcode
The best way to install it is through Alcatraz . Download the Alcatraz repo from GitHub and install it using Xcode compilation. After that, restart Xcode and press ??9 , open Alcatraz , search VVDocumenter , click on the top left corner INSTALL , and it will be installed automatically.
If you do not want Alcatraz to install by, we can also download Vvdocumenter repo, in Xcode to compile to install. After you restart Xcode, you can use /// the Generate annotations from the motion.
If you don't like it /// , you can find vvdocument in the Xcode Window menu, open the Settings panel, and modify Trigger Input the entry. In the settings option, you can also modify the number of spaces in the tab and the style of the generated comments.
Version of Xcode
Starting with Xcode 5.0, Apple has added UUID validation to all plugins to ensure that Xcode is stable after the update. The value in the plugin's plist file contains the UUID of the DVTPlugInCompatibilityUUIDs current Xcode version, otherwise the plug-in does not work.
Starting with Xcode 6.3, if we use plugins, we will be prompted Load third party bundle . We should choose Load bundles to ensure that the plugin is available. If we accidentally choose skip bundle , you can reset this prompt using the command line below.
All plugins will be invalid when Xcode is updated. Because the value in the plugin's plist DVTPlugInCompatibilityUUIDs does not contain the most recent version of Xcode's UUID. At this point, we should try to remove the vvdocument from the plugin directory (by default ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins ), then clone from the master branch and compile the latest version. You can also try using Alcatraz reinstall.
More plugins
The use of plugins in Xcode will make our development faster. Tang Qi in the "iOS Development Advanced" book, we recommend a lot of useful plugins. You can also Alcatraz find the right plug-in for yourself.
Below, attach the commonly used plugins mentioned in the "iOS Development Advanced" book.
-
Ksimagenamed is a plugin that can help you enter [UIImage imageNamed:] the name of a resource. When you type [UIImage imageNamed:] , it will automatically pop up the context menu, for you to choose the name of the image resource you need to enter, and in addition to the image resource, you can also preview the resource on the left.
-
Xvim is a Xcode vim plugin that enables VIM mode in Xcode's editing window. The biggest benefit of Vim mode is that you can move the cursor easily, as well as copy and paste the code, with full keyboard operation. Xvim also has a good support for Xcode's column mode, which, like Vim's own column mode, can be used to toggle the currently edited column by using the shortcut key Ctrl + W.
-
Fuzzyautocompleteplugin allows for automatic code completion using a fuzzy approach. For a chestnut, if we want to reload Viewdidappear: method, then we must type view, did, appear to get the corresponding completion information, after using Fuzzyautocompleteplugin, we can type the VDA (view, Did, appear the first letter of three words), or any substring that matches the order in which viewdidappear entire word appears (such as vdapp,idear, etc.), can be matched to that method.
-
Xtodo is a find all of the items with Todo, Fixme 、???、!!! The comment for the tag. Usually we are in the project development, for a variety of reasons, some things need to be dealt with later, this time to prevent forgetting, plus todo or fixme comments is very necessary, but to go online or submit code before the search for these unresolved issues is a bit troublesome. Xtodo can provide a summarized interface that displays all outstanding todo and fixme tags in a centralized display.
-
Bbudebuggertuckaway is a very small tool that can automatically hide the debug window at the bottom when you edit the code. Because normally, debugging is the time to add breakpoints or monitor variable changes, or in the console window with a PO to output some debugging information. If you start to edit the code, the debugging is finished, this time to hide the debugging window, you can give the editing interface more space for us to modify the code.
-
Scxcodeswitchexpander can help you quickly populate the switch statement with each of the possible values of the enumeration type. For example, when you enter switch and then type the Nstableviewanimationoptions class, the plug-in will complement its possible values after each case.
-
Deriveddata-exterminator is a plug-in that clearly lists the Xcode cache directory. Sometimes there are strange problems with Xcode, most often in some complicated operation (for example, in the same project, switching back and forth to various branch versions), will cause Xcode to display some compiled errors or warnings, but eventually can be compiled through. Novice users are often overwhelmed by this problem, and people familiar with Xcode know that it is often possible to clear the Xcode cache to solve such problems. The plugin adds a button to clear the cache on the Xcode menu, which makes it easy to clear the cache with one click.
-
Clangformat is a tool that automatically adjusts the style of the code. Xcode's own code indentation auto-tuning feature is weak, especially in JSON format, which often produces very ugly default indentation effects. Clangformat-xcode can re-typeset the code better, with a built-in layout style and support for custom styles.
-
Colorsense is a uicolor color input helper that helps you to preview the color in real time when writing Uicolor code.
-
Xcodeboost contains several minor features that assist in modifying code. Like what:
-
You can easily expose the definition of a method in a. m file to the corresponding. h file.
-
You can enter a regular expression lookup directly in one of the source files.
-
You can copy and paste code without the automatic indent feature of Xcode enabled. Xcode's automatic indentation is often problematic, resulting in the adjusted code indentation, which was tweaked by Xcode when pasting.
Go to: http://www.thinksaas.cn/topics/0/399/399417.html
Make iOS development easier with the Xcode plugin