Formatting Swift

One thing I enjoy about Flutter development is escaping the confines of Xcode. In particular, Visual Studio Code and your formatting extensions, where have you been all my life?

In Xcode, I didn't even know about Control-I, so I've been manually indenting like I'm still typing BASIC code on my typewriter in the early 80s.

But Control-I isn't much better, so I googled for some third-party help. Now I'm trying out the open-source Xcode extension Swimat.

It's an app (downloadable or installable via brew), that performs the actual installation, and it's one of those apps that Apple will complain about not being from a recognized developer, so you'll have to the the whole Open... thing in the Finder.

You'll also have to go into Preferences and enable Swimat as an Xcode extension.

And then, after restarting Xcode, you'll find Swimat in the Editor menu (not the Edit menu, and I have to say, that is confusing).

Selecting Format will format the current file. And if something doesn't look right to you, check the issues.

Subscribe to Technicat

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.