A way to automatically organize #imports in Xcode

后端 未结 9 1598
眼角桃花
眼角桃花 2021-01-30 20:38

I love the \"Organize Imports\" command in Eclipse to implicitly add and remove classes imported into a source file (as in Java or ActionScript).

Is there a command in X

9条回答
  •  日久生厌
    2021-01-30 21:03

    Swiftlint has an opt-in rule which if opted, will automatically sort the imports alphabetically.

    Add - sorted_imports to your .swiftlint.yml file under opt_in_rules.

    Run swiftlint autocorrect terminal command on project root directory (same where swiftlint.yml is stored).

提交回复
热议问题