unused.rb
Searches for unused swift functions, and variable at specified path
cd <path-to-the-project>
<path-to-unused.sh>/unused.rb
Item< func loadWebViewTos [private] from:File.swift:23:0>
Total items to be checked 4276
Total unique items to be checked 1697
Starting searching globally it can take a while
Item< func applicationHasUnitTestTargetInjected [] from:AnotherFile.swift:31:0>
Item< func getSelectedIds [] from: AnotherFile.swift:82:0>
To integrate this into Xcode, simply add a "New Run Script Phase" and use the following code:
file="unused.rb"
if [ -f "$file" ]
then
echo "$file found."
ruby unused.rb xcode
else
echo "unused.rb doesn't exist"
fi

- Fully text search (no fancy stuff)
- A lot of false-positives (protocols, functions, objc interoop, System delegate methods)
- A lot of false-negatives (text search, yep)