Swift: What Apple missed in Xcode

Peppermint
2 min readAug 23, 2015

--

So, you’re a developer. The Mac-kind of developer. Meaning: OSX apps, or most likely iOS apps.

In a few words, if — like me — you used to be a Windows/Linux (anything else) developer, in order to explore the wonderful world of Mac development, you know one thing: you had to learn a beast called Objective-C.

Now, I have to admit, after lots and lots of years of developping almost solely for Mac, that I still miss something more old-school or… “regular”.

The Swift era

And then came Swift. Much more versatile. Faster. Simpler. Easier to get used to, if you’re the average coder (and not started your coding life with SmallTalk, that is). Now, I could add a long list of adjectives, all ending in “-er”.

But that’s enough. Let’s go back to Swift.

You start playing with it. And you love it. Pretty much like when Apple introduced Objective-C v2.0 and made you forget how… elegant it is to write a whole paragraph, full of brackets, only to define a new array or dictionary.

And you definitely want to get your hands dirty with this new toy of yours.

Switching to Swift

But no matter how bad you want to “switch to Swift”, you know there’s still something missing. It’s fun, it’s fast, it’s cool. But…

What about the loads of code you have written in the past? Libraries, frameworks, code you use and re-use all the time. Yep, all in Objective-C!

You then look for the usual Refactor option, like back in the time when ARC or Objective-C 2.0 first appeared — a magic button to make your sources up-to-date automagically.

Ooops…

And then you realize there’s no such thing. No automated way of converting your Objective-C sources to Swift. Not in Xcode. Not anywhere. All you can do is manually translate all of your libraries one-by-one, or simply try to mix the two of them, hoping that your project won’t break.

And then it struck me:

- I’m a developer, right? The Mac-kind, huh?
- Right.
- So?
- Let’s create it!

And that’s how it happened. And the crazy idea of creating, what Apple obviously missed (or avoided?), became a reality: an automated Objective-C to Swift converter for Mac.

And it’s name: iSwift. :)

P.S. The tool is currently under heavy development. But trust me: it’s working. And if you still want to take it for an… online test-drive, have a look at the Online Objective-C to Swift converter. Feedback is more than welcome! ;-)

--

--

Peppermint

The tweakable, batteries-included, Swiss Army knife for Coding on your Mac. –– By Dr.Kameleon