With Checker you can find circular dependencies in your Swift project. Having circular dependencies are a sign of potential problems. They should be avoided. Checker integrates beautifully with Xcode: It automatically checks for circular dependencies every time your hit ⌘ + R.

Download Checker

(Version 1.0.0 Beta; requires macOS 10.11.)

Checker: Instructions

Checker: Results

Checker: Circular Dependency

Will Checker slow down my build process?

If Checker is integrated in your Xcode project as a Run Script build phase then your build process should not be slowed down significantly. The script merely executes a little helper utility (start-analyzer). In turn, this helper utility just triggers a analysis. The actual analysis is performed by the Checker app. If the Checker app is not running (or not even installed) the build phase exits with EXIT_SUCCESS. start-analyzer has a hard timeout: It will terminate after 5 seconds.

How does it work?

Checker looks at every Swift file and basically determines two things:

  1. Which dependencies does this file have?
  2. Which types does this file provide?

Based on these information Checker creates a dependency graph which is then used to quickly find cycles.

Do I have to remove every circular dependency?

No. Although a circular dependency is usually a bad sign sometimes it is just what you want. You should however, keep circular dependencies to a minimum.

Are there false positives?

Yes. In rare cases it can happend that Checker reports something as a circular dependency which in fact does not exist. Please get in touch if this happens to you.