Xcode Plugin Manager: Alcatraz
No doubt that Xcode is the most appropriate IDE for developing cool iOS and Mac apps. All useful features those are required throughout the lifecycle of an app, are effectively integrated within Xcode. However, some cool features are still missing. Have you ever thought of maintaining proper alignment of your code in Xcode? Is there any built-in tool to do that? What about creating an Apple like method documentation for the functions defined within the code? You can add new features to your Xcode easily and make it more usable. Want to know how? Read on this article.
First, download Alcatraz Xcode package manager:
You can download the most popular Xcode plugin manager from the official website of Alcatraz. This plugin manager is only available for Xcode 5.0 or higher versions. To download the plugin manager just run following command in your terminal.
curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh | sh
Next, we will see how to download VVDocumenter, XAlign and XToDo using Alcartaz Plugin Manager
1. VVDocumenter (Function Documentation Plugin)
Let’s see how to download VVDocumenter using Alcartaz Plugin Manager:
a) Open Alcatraz plugin manager. Search VVDocumenter. Install it by clicking the install button located on right side of the VVDocumenter-Xcode in the list.
b) Now quit and restart Xcode. You will see VVDocumenter menu option under the Window menu of Xcode.
If you are facing problems installing VVDocumenter, you can download it from GitHub and run the project. Now you quit and restart Xcode.
c) Open VVDocumenter to configure it according to your requirement.
Usages of VVDocumenter:
Open the file (preferably interface file with .h extension for Objective-C projects) where you have declared the method of a specific class. Move the cursor to the line just above the declaration or definition (for .swift files) of the method for which you are going to make documentation. Type three “/” consecutively. VVDocumenter will automatically add documentation code snippet for the underlying method. The following two .gifs collected from VVDocumenter’s GitHub repository clearly shows the process.
2. XAlign: The Alignment Plugin for Xcode
Here are the steps:
a) Download the XAlign plugin using the PackageManager. Once download is complete, quit and restart Xcode.
b) You can find out it from Edit menu of Xcode.
Usages of XAlign:
XAlign automatically aligns selected code in Xcode with keyboard shortcut Command + Shift + X. Here are two examples.
3. XToDo: The special comment plugin for Xcode
Sometimes we do use //TODO: , //FIXME: , //???: and //!!!: comment tags for different purposes like:
- Writing due development code, //TODO:
- Fixing tag for a detected bug, //FIXME:
- Attention catching code snippet, //!!!: and
- For some questionable code. //???:
Tags at work:
Suppose you have NSObject‘s child class name MyClass. Just write down the following code snippet at the very end of MyClass.m file.
///TODO: To do list
///???: Questionable code
///FIXME: Sample Fix me
///!!!: Need further clarification
Now you can see the effects of these special comment tags from the @implementation detail list of MyClass.m
Steps to integrate XToDo with Xcode:
>a) Download the plugin form PackageManager.
b) Quit and restart Xcode, open the View menu, you can see something like that.
Now and onwards you can add the following special comment tags by using keyboard shot-cuts
- //TODO : [CTRL + SHIFT + T]
- //FIXME : [CTRL + SHIFT + X]
- //!!! : [CTRL + SHIFT + 1]
- //??? : [CTRL + SHIFT + Q]
Where to go from here?
A lot of other plugins are available to download from Alcatraz plugin manager. You can see the preview of it and can also go to the GitHub repository of that plugin.
If you want more details about method documentation in Xcode you can go through this blog . To learn about more about Alcatraz, you may visit it’s official website. If you have any questions or comments on this tutorial, please feel free to ask or leave a comment.