blog

Beautify Your Objective-C Code

by | May 29, 2013 | Developer Blog | 4 comments

Uncrustify is an open source code formatting tool for various languages including C, C++ and C#. It can also be used to format Objective-C code.

Uncrustify offers a large number of fine-grained options for code formatting that can be somewhat daunting to set up. The tool I want to mention here is a GUI application written by Ryan Maxwell that provides a neat user interface for setting the options for code formatting for Objective-C code. It is an application called UncrustifyX.

Here is a screenshot of the main window. It is easy to change the setting of an option on the left side and see its effect on the code on the right.

Image
Clicking on the Info button for any option shows more detail about that option as shown here.
Image
This GUI tool provides a way to define the formatting options exactly as you want. These options can then be saved as a configuration file. The command-line version of uncrustify can then use this configuration file to format source files. There is also an Xcode plugin available that modifies the Edit menu of Xcode to offer options for uncrustify.
More information about this tool for Xcode can be found [here](http:/https://bit.ly/3id1sPe/ “here”).

+ more

Accurate Timing

Accurate Timing

In many tasks we need to do something at given intervals of time. The most obvious ways may not give you the best results. Time? Meh. The most basic tasks that don't have what you might call CPU-scale time requirements can be handled with the usual language and...

read more