What is “swiftformat” Package?

Formatting tool for reformatting Swift code
For more details: https://github.com/nicklockwood/SwiftFormat

Installation

  • Open Terminal by pressing command+space then type terminal and hit Enter key.
  • Install homebrew first.
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
  • Install swiftformat.
    brew install swiftformat

Now, use swiftformat!