A Tool To Automatically Keep Your Xcode Storyboards And Code In Sync To Avoid Runtime Failure

Sometimes when using the Xcode storyboard tool you’ll run into issues with your code being out of sync with your Storyboards and often this can lead to very annoying difficult to track down issues where things will fail at runtime, but still compile.

Here’s a tool called StoryboardLint from Johannes Fahrenkrug that uses Lint static code analysis to automatically sync your code and Storyboards together.

According to the readme StoyryboardLint does the following:

– Makes sure your UITableViewCell and UICollectionViewCell reuse identifiers are named according to StoryboardLint’s naming convention.
– Makes sure your Storyboard and Segue identifiers are named according to StoryboardLint’s naming convention.
– Makes sure that all custom classes that are references from your Storyboard actually exist is your code.
– Makes sure that all string literals in your code that reference reuse identifiers, Storyboard identifiers and Segue identifiers (according to the naming convention) actually exist in your Storyboard(s).
– Produces output that is parsable by Xcode so you can easily plug StoryboardLint into your build process

The tool comes in the form of Ruby Gem and can be installed with:

sudo gem install storyboardlint

You can find the StoryboardLint source code and documentation on Github here.

A nice way to make sure your code doesn’t mess up things with the Storyboards tool.

 

FacebookTwitterDiggStumbleUponGoogle Plus

Original article: A Tool To Automatically Keep Your Xcode Storyboards And Code In Sync To Avoid Runtime Failure

©2014 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.

Leave a Reply

Your email address will not be published. Required fields are marked *