There are many situations when you may want to enforce custom code formatting rules on an Xcode project, this can be especially important if you’re working as part of a team.
Xcode formatter is a script that makes it easy to format your code based on a set of rules.
The features as stated on the readme include:
– Xcode shortcut-based code formatting: a shortcut to format modified sources in the current workspace
– automatic code formatting: add a build phase to your project to format current sources when application builds
– all sources formatting: format all your code with one command line
– your formatting rules shared by project: edit and use a same configuration file with your project dev team
You can find Xcode Formatter with full instructions how to integrate with your Xcode project on Github here.
The Uncrustify source code beautifier is used for the code formatting.
A great script to have around if you’re working with a team that wants you to enforce some atypical formatting rules.
Original article: Xcode Code Formatter Tool Enabling Automatic Code Formatting Based On A Custom Rule Set
©2012 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.