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 StoryboardLint 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:
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.
Submit A Resource
Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?
You can submit the url here.
The resources we feel will appeal to our readers the most will be posted on the front page.