Did you know you can use Copilot with an Xcode project? 🤖

Hi 👋

Last week was quite exciting for me: I attended the conference Swift Island for the first time, to give a workshop about the new Swift macros.

As the name suggests, this conference happens on an island called Texel, on the west coast of the Netherlands.

The place is really beautiful, here are a couple pics to give you an idea:

I really enjoyed the conference, so if you have the opportunity I definitely recommend attending their next edition: it’s a really great way to conclude your summer 😌

And now before I start this email, I have a big thank you to my sponsor of the week: RevenueCat 😼


Advertisement

RevenueCat makes adding subscriptions to your app simple🚀

Never worry about StoreKit 🤦‍♂️📱

Plus, get out-of-the-box charts and reporting for your app 📈📊

👉 Try it for free 👈


Sponsors like RevenueCat really help me grow my content creation, so if you have time please make sure to have a look at what they offer: it’s a direct support to my content creation ☺️


If you’re like me, you might have been a bit disappointed by the lack of any new AI-based feature that helps developers write code in Xcode 15.

That lack of an AI feature is even more frustrating when you know that it’s been more than 2 years since Microsoft has released Copilot 🥲

But did you know that it’s actually possible to use Copilot with an Xcode project?

That’s a bold claim that I’m making so you might be wondering: “where’s the catch?”

The catch is that, while it’s possible to use Copilot with an Xcode project, it won’t be inside of Xcode itself.

Instead, you’ll need to use VSCode to edit your source files with the help of Copilot, and then switch back to Xcode to build your app.

Nevertheless, giving it a try is quite the fun experiment and depending on the kind of code you write, it might even become a trick that you’ll find yourself using on a regular basis!

So how do you set up Copilot so that it works with Swift code?

You basically just need to install an extension inside VSCode.

I recommend this article that provides a really good overview of the steps.

And once everything is setup it’s time to experiment!

There are two use cases I would recommend you give try:

  • refactoring existing code with the help of Copilot

  • having Copilot help you write a simple app from scratch

What if I don’t have time to download and setup VSCode?

Don’t worry, I’ve got you covered!

Last year I recorded two videos on that topic: they’re a great way to see Copilot in action with zero effort 👌

In the first video, I used Copilot to refactor a codebase from MVC to MVVM:

And in the second video, I used Copilot to implement a Todo List app from scratch:

(keep in mind that Copilot might have gotten even better since I’ve released these two videos one year ago!)

That’s all for this email, thanks for reading it!

If you’ve enjoyed it, feel free to forward it
to your friends and colleagues 🙌

I wish you an amazing week!

❤️

Previous
Previous

Hidden feature: private properties

Next
Next

Bad practice: capturing self in a nested closure