Skip to content

thefotes/AbandonedConstraints

Repository files navigation

Abandoned Constraints


What Are Abandoned Constraints?

Abandoned constraints are those which are uninstalled but not yet deleted from your storyboard/xib file. In the image below note the two constraints which are listed in the "disabled" state. That is, their icon is not as dark as the others.

unused constraints

How This Script Works

Since storyboard and xib files are really just XML files, they're easy enough to edit from the command line. This script will go through and find all of those constraints which've been "excluded" and remove them. Please note that this script is destructive.

Usage

  1. Clone repo
  2. Run ./script.sh <path-to-xcode-project>

Thats it, the script will report back to STDOUT as it deletes the unused constraints and when its all done you can go into your (hopefully source controlled) project and view a diff of what was deleted (if anything)

Twitter

@peterjfoti

MIT License and Contributions are Welcome!

About

Find and remove unused constraints in your .storyboard and .xib files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published