How to format swift similarly among teammates

I recommend to use SwiftFormat.

https://github.com/nicklockwood/SwiftFormat

  1. Make a bash file that runs swiftFormat
echo ""
__system "Run swiftformat.."
Pods/SwiftFormat/CommandLineTool/swiftformat -c .swiftformat .

__system "Done"

2. add bash file command to the pre-commit hook.

./chore.bash