macOS, iOS

[iOS] Xcode reindentation은 swift format

SweetDev 2020. 4. 23. 12:13

 

  • https://github.com/nicklockwood/SwiftFormat 에 가서 Zip파일을 다운로드한다.
    • 전체 repository를 download zip해주고, EditorExtension 폴더만 쓴다. 
  • 압축을 풀고 EditorExtension - SwiftFormat for Xcode.app를 응용프로그램 폴더로 이동시킨다.
  • SwiftFormat 을 실행시켜서 Infer Options Automatically를 체크해제하고(실행 안되면 시스템 환경설정 - 보안 및 개인정보보호에서 실행권한을 줘야한다)
    • Indent: 2
    • unusedArguments: 체크해제
  • 시스템 환경설정 - 확장 프로그램 - 모두 - SwiftFormat For Xcode 에 체크한다.
  • Xcode - 설정 - Key bindings - entire 로 필터링 - Format Entire File 에 원하는 단축키 지정(나는 command + alt + control + i를 넣었다)
  • Xcode - 설정 - Text Editing에서 Indent 관련된 항목을 모두 2 space로 바꾼다.

 

처음부터 brew로 받을걸..업데이트할때마다 지우기 귀찮다ㅠㅠ