If you’re familiar with vscode but hate the ui of xcode, you can open your projects in vscode.
Open the terminal in the project directory and run code .
to open it in vscode
At this point, when we open a swift file, we can’t use language features like clicking on a function to go to definition and all. For that, we need to install 2 more extensions.
- SweetPad
- Swift official extension
Then click cmd+shift+P
to open the vscode command palette and search for SweetPad: Generate Build Server Config
and click enter.
It’ll create a buildServer.json
file.
If we open a Swift File again, we’ll have rich language features. ✨
Debugging
If the language features not working after these steps, try the below.
- Reload the vscode by running
Developer: Reload Window
from the vscode command palette - Select the Xcode Toolchain by running
Swift: Select Toolchain
from the vscode command palette.
Happy coding :)