SwiftFormat 설치
brew install swiftformat
SwiftFormat 적용
Xcode 프로젝트 - TARGETS - Build Phases - New Run Script Phase
추가된 Run Script에 아래 내용을 넣는다
if [[ "$(uname -m)" == arm64 ]]; then export PATH="/opt/homebrew/bin:$PATH" fi if which swiftformat > /dev/null; then swiftformat . --swiftversion 5 else echo "warning: SwiftFormat not installed, download from https://github.com/nicklockwood/SwiftFormat" fi(선택) Run Script의 이름을 SwiftFormat으로 변경한다
Based on dependency analysis체크 해제Compile Sources 바로 이전으로 순서를 변경한다
만약 SwiftLint를 사용한다면, 아래 순서로 배치한다
... > SwiftFormat > SwiftLint > Compile Sources ...