·3 min read

Exploring Cursor: Autocompletion with Tab


This chapter is taken from my book, "AI Assisted Coding for iOS Development". You can buy it to learn further about Cursor:

Exploring AI Assisted Coding


The first step for working with Cursor for me was to get the keyboard shortcuts working for building and running the project on simulator and device.

Exploring Cursor: Building and Running on Simulator

The second step is to have overpowered autocompletion. Cursor Tab suggests changes across multiple lines which works well with SwiftUI:

It even suggests completion in third-party frameworks, and it is better than whatever Apple shipped with the predictive model. I know it is unfair to compare an on-device model, but hey, I am getting impatient waiting for Swift Assist.

From a convenience point of view, Cursor wins.

Coding should be fun, and I am glad there is an alternative to let me tab tab tab and enjoy the outcome.

Just a few characters, and you get the accurate method implementation.

Autocomplete

I mentioned about this awesome extension in the last post for easily building and running projects called as Sweetpad:

SweetPad (iOS/Swift development) - Visual Studio Marketplace

I missed that it also supports autocomplete!

The installation is straightforward. You start off by installing Swift Language support from the marketplace:

Swift - Visual Studio Marketplace

EVisual Studio Marketplace

](https://marketplace.cursorapi.com/items?itemName=sswg.swift-lang)

Then, install Xcode-Build-Server to integrate Xcode with sourcekit-lsp. Here are some installation methods:

git clone "https://github.com/SolaWing/xcode-build-server.git" && ln -s "$PWD"/xcode-build-server/xcode-build-server /usr/local/bin

Brew:

brew install xcode-build-server

Macports:

sudo port install xcode-build-server

Then, run the command SweetPad: Create Build Server Config from the command palette at the top or Shift + Command + P.

The autocomplete is not that good relative to Xcode's normal completion, but when combined with Cursor Tab, you are in for a treat!

Moving Forward

Switching IDEs is a friction in itself. And many have to deal with a bigger codebase code generation over multiple files is tricky. But I will take anything over the buggy Xcode 16.0.

Cursor was the breath of fresh air I needed in my iOS development journey. And the fact that as Cursor evolves, we will see autocompletion and code suggestions over multiple files, as mentioned in this fantastic podcast:

And more iOS devs using Cursor means more shared shortcuts, extensions, and tricks. The team definitely seems committed to making things faster and smoother.

Is Cursor going to replace Xcode entirely?

Of course not.

Another great tool in your developer toolbox. Experiment and find what works for you.

Maybe you find Xcode your purpose.

Or maybe, like me, you will find yourself reaching for Cursor more often than not, enjoying the outcome of programming than programming itself

Happy Cursoring!

Post Topics

Explore more in these categories:

Related Articles

Exploring AI: Cosine Similarity for RAG using Accelerate and Swift

Learn how to implement cosine similarity using Accelerate framework for iOS and macOS apps. Build Retrieval-Augmented Generation (RAG) systems breaking down complex mathematics into simple explanations and practical Swift code examples. Optimize document search with vector similarity calculations.

Exploring Cursor: Accessing External Documentation using @Doc

Boost coding productivity with Cursor's @Doc feature. Learn how to index external documentation directly in your workspace, eliminating tab-switching and keeping you in flow.

Exploring Cursor: Browsing the Web for Resources using @Web

Discover how Cursor's @web command helps with coding workflow. While AI assistants like Claude 3.5 Sonnet can't browse the web, Cursor lets developers search online directly in their editor. From finding iOS 18 APIs to accessing SwiftUI documentation, stay focused and code efficiently.