CFHipsterRef Low-Level Programming on iOS & Mac OS X

Third-Party Tools

appledoc

In Objective-C, the documentation tool of choice is appledoc 66. Using a Javadoc-like syntax, appledoc is able to generate HTML and Xcode-compatible .docset docs from .h files that look nearly identical Apple’s official documentation.

brew install appledoc
  • @param [param] [Description]: Describes what value should be passed or this parameter
  • @return [Description]: Describes the return value of a method
  • @see [selector]: Provide "see also" reference to related item
  • @discussion [Discussion]: Provide additional background
  • @warning [description]: Call out exceptional or potentially dangerous behavior

To generate documentation, execute the appledoc command within the root directory of an Xcode project, passing metadata such as project and company name:

appledoc --project-name CFHipsterRef \
    --project-company "NSHipster" \
    --company-id com.nshipster \
    --output ~/Documents \
    .

xctool

xctool is a drop-in replacement for xcodebuild, the utility underlying Xcode.app itself.

brew install xctool

Every step of the build process is neatly organized and reported in a way that is understandable and visually appealing, with ANSI colorization and a splash of Unicode ornamentation, but xctool's beauty is not just skin-deep: build progress can also be reported in formats that can be read by other tools:

xctool -reporter plain:output.txt build
  • pretty: (default) a text-based reporter that uses ANSI colors and unicode symbols for pretty output.
  • plain: like pretty, but with with no colors or Unicode.
  • phabricator: outputs a JSON array of build/test results which can be fed into the Phabricator code-review tool.
  • junit: produces a JUnit / xUnit compatible XML -ile with test results.
  • json-stream: a stream of build/test events as JSON dictionaries, one -er line (example output).
  • json-compilation-database: outputs a JSON Compilation Database of build events which can be used by Clang Tooling based tools, e.g. OCLint.

OCLint

OCLint is a static code analyzer that inspects C code for common sources of problems, like empty if/else/try/catch/finally statements,unused local variables and parameters, complicated code with high NCSS (Non Commenting Source Statements) or cyclomatic / NPath complexity, redundant code, code smells, and other bad practices.

brew cask install oclint
$ xctool -workspace NSHipster.xcworkspace \
    -scheme "NSHipster" \
    -reporter json-compilation-database \
    build > compile_commands.json

$ oclint-json-compilation-database

xcpretty

gem install xcpretty

Nomad

gem install nomad-cli

Cupertino

Shenzhen

Houston

Venice

Dubai