A tool to create a graph representaton of your .storyboard
files.
git clone https://github.com/IBDecodable/IBGraph.git
cd IBGraph
make install
If not already installed yet, install Swiftbrew with Homebrew
brew install swiftbrew/tap/swiftbrew
then type
swift brew install IBDecodable/IBGraph
You can see all description by ibgraph help
$ ibgraph help
Available commands:
help Display general or command-specific help
generate Show graph (default command)
version Display the current version of ibgraph
$ ibgraph
FirstViewController -> ["SecondViewController"]
$ ibgraph --reporter dot
digraph {
0 [label = "FirstViewController"];
1 [label = "SecondViewController"];
0 -> 1;
}
# or ibgraph if reporter defined in configuration file
Example on IBAnimatable demo app
or if you ave graphviz
installed you can open preview
ibgraph --reporter dot | dot -Tpng | open -Wfa preview
This reporter open the graph on https://dreampuf.github.io/GraphvizOnline/
$ ibgraph --reporter online
Open url https://dreampuf.github.io/GraphvizOnline/#digraph....
First use dot
reporter.
Then you can install graphviz
using Homebrew
brew install graphviz
And finally launch the convertion using dot
command on your result file
dot -Tpng MyStoryboards.dot -o MyStoryboards.png
or directly after ibgraph
launch
ibgraph --reporter dot | dot -Tpng -o MyStoryboards.png
Add a Run Script Phase
to integrate IBGraph with Xcode
if which ibgraph >/dev/null; then
if which dot >/dev/null; then
ibgraph generate --reporter dot | dot -Tpng -o storyboards.png
else
echo "warning: dot from graphviz is not installed, check how to install here https://github.com/IBDecodable/IBGraph#convert-graph-to-png"
fi
fi
else
echo "warning: IBGraph not installed, download from https://github.com/IBDecodable/IBGraph"
fi
IBGraph requires Swift5.0 runtime. Please satisfy at least one of following requirements.
- macOS 10.14.4 or later
- Install
Swift 5 Runtime Support for Command Line Tools
from More Downloads for Apple Developers
You can configure IBGraph by adding a .ibgraph.yml
file from project root directory.
key | description |
---|---|
excluded |
Path to ignore. |
included |
Path to include. |
reporter |
Choose the output format between default , dot , json , gml and graphml . Or online to open graph on default browser. |
included:
- App/Views
reporter: "dot"