Oct 22, 2016 ⌘
Most of the time circular dependencies are bad. You usually don’t want to have them. During the last couple of days I developed a small tool which finds circular dependencies in Swift code. It is not perfect but it works pretty well already. The tool finds circular dependencies between Swift files. You use the tool by integrating it into your Xcode build process. Once integrated the tool analyses your project every time you build it. The tool has to run while you work in Xcode.
Circular dependencies are visualised like this:
You can click on the Swift icon to jump directly to the corresponding file. By default the most complex circular dependency is displayed immediately once the analyser has done it’s job. Use the popup menu to navigate to the other circular dependencies.