My Experience With Cursor for iOS Development
#iOS App Development
I've spent a few weeks playing with Cursor for iOS App Development .
For now my conclusion is that:
- It's already workable
- Not without sharp corners. Sometimes, it's annoying, but it already brings more benefits than inconveniences.
- That's the future of the development workflows. It won't probably take our jobs, but will improve the overall experience
The Good
It's just good enough to continue using it no matter of all inconveniences:
- Handles dumb boilerplate perfectly. Kinda of on-the-fly code-gen tool that you don't have to set up templates for.
- It's an in-place alternative to documentation, stack overflow, and Google search that is accurate for simple cases most of the time.
- It can be handy for solving basic problems when you exactly know what should be done but don't know the exact syntax.
- Can be very helpful for those kinds of refactoring when you have to edit boring boilerplate-like things.
- I would say that it can improve the overall coding experience because it removes the most disgusting part: tons of manual text editing.
- It's capable of following particular code: it autocompletes things similarly to what you already have in the context.
Tha Bad
Most of the issues I face are more like a question of habit and taste, but many things feel just odd after Xcode. Some of the weird experiences come from the fact that VSCode code editing UX is slightly different from Xcode.
Many slight differences accumulate and become annoying: error messaging and highlighting, code blocks folding/unfolding, automatic formatting and indentation, and autocomplete for variables, parameters, and functions (not the AI-driven, but the compiler-driven).
Compiler Integration and Error Handling
Partly it's because of the deep integration of Xcode and compiler.
Xcode is constantly re-indexing and re-building the project in the background so you don't even have to build the project to face compiler errors: Xcode just highlights them on the go and suggests in-place fixes that can be applied with a single click and it will be exactly correct.
VSCode/Cursor does a similar thing thanks to SourceKit-LSP integration. Unfortunately, it's just not as smooth as in Xcode: error highlighting sometimes appears in the wrong place with an unclear error message, making it harder to figure out what has gone wrong. Sometimes it highlights errors by mistake.
In Xcode, I usually feel very safe to break even a HUGE chunk of code and make massive refactoring. The compiler somehow gives me confidence. In VSCode/Cursor I don't feel that confident and it seems like it's harder to rely on a strongly typed Swift in VSCode/Cursor than in Xcode.
Sometimes it feels like editing code in a plain notepad while AI shoots me with autocomplete tabs here and there.
Autocompletion UX
Again, thanks to SourceKit-LSP integration, code autocompletion works just fine, but sometimes it behaves differently and inserts things you would never expect if you got used to Xcode. For eg, closing brackets. Cursor's AI autocompletion often makes it even more annoying, sometimes turning the process into a back-and-forth fight with the mistakenly inserted trash.
When you type the code, and try to recollect the exact API. The autocomplete driven by the compiler will usually insert the right thing for you. AI-driven autocomplete often tries to "guess" which sometimes results in a wrong thing, just like you trying hard to recall the actual API.
I often use "tab" for indentation. Cursor AI sometimes decides to suggest something at the very last moment and it gets mistakenly inserted. Sometimes it suggests indentation. Sometimes not. Other times the suggested indentation is wrong because I've already added one. Very annoying.
Please, don't suggest me switching to "4 Spaces"
At the same time, I find Cursor AI intelligent but not 100% of the time. Very often it gets stuck when you are expecting an obvious autocomplete
Read More about other pitfalls of using Cursor for iOS development.
Comments