How to use AI (and Cursor) to improve your iOS skills
You’re more of a video kind of person? I’ve got you covered! Here’s a video with the same content than this article 🍿
Advertisement
Make iOS Apps using AI, with Alex Sidebar
Take advantage of our coding agent, built specifically for Swift. Generate modern SwiftUI from images. Fast Apply suggestions from Claude 3.5 Sonnet, o3-mini, and DeepSeek. Autofix errors and warnings. Enable thinking and web search. And so much more.
Sponsors like Alex Sidebar really help me grow my content creation, so if you have time please make sure to check out their survey: it’s a direct support to my content creation ☺️
In this article, I want to show you a clever trick to discover new useful iOS coding patterns with the help of AI.
(spoiler alert: this approach did make me discover an interesting pattern that I had never seen before!)
So what's the setup?
I've downloaded the codebase of Signal, a popular open-source iOS app.
Then I've opened the project inside Cursor, which is an IDE integrated with Claude and ChatGPT.
Cursor has a really nice feature: it allows you to chat with your codebase.
So I’m going to use this feature to ask the AI to find in the codebase something that would help an iOS developer improve their skills:
The first answer wasn’t amazing: the AI mentioned how views and view controllers can be initialised programmatically.
It’s perfectly correct, but it’s also very likely that an iOS developer with a bit of experience will already be aware of it:
But don’t let that first answer stop you!
Asking the AI for another example might yield a much better result.
On a second try, the AI showed me how to use the property observer didSet
to make sure that the cornerRadius
of a CircleView
always gets updated when either its frame
or bounds
changes:
And on the third try, the AI even showed me a pattern that I had never seen before: using the property observer willSet
to trigger a runtime error during development when an inherited property is mistakenly set:
(notice how the AI incorrectly uses the term property wrapper, even though it’s actually a property observer that’s being used here!)
That’s all for this article, I hope that you’ve enjoyed discovering this clever usage of AI!
If you want to give it a try for yourself, you can find lists of open-source iOS apps here and here.