- AI
- A
Copilot Overview in Xcode on SwiftUI
So, I finally got around to Copilot. I was really curious how exactly it could help me with writing code. So, tekkixocatans, if you’re interested, I invite you to read further.
There are several ways to work with Copilot.
The first option: like with ChatGPT – you ask a question, request a specific code, copy it, paste it. No difference, except there aren't as many models to choose from. GPT also works with Xcode and specific files, so I didn't see anything new.
Below are 2 images for comparison:
The second option seemed a bit more interesting to me: write in the code comments what needs to be added, and then Copilot adds the necessary function or model. You can add line by line or the entire proposed code at once.
Pros: no need to copy, it writes exactly what is needed (without extra imports, previews, etc.). Cons: like in the first option - it only sees the code within a single file, not analyzing the entire project.
Also, with a bit of luck, you can write errors through comments and theoretically it can fix them.
And the third option, the one I use most often – it's just code autocompletion. Here too, there are pros and cons. When you need to create something standard, it works well, but if you need to take other files in the project into account, it can be a bit messy. Below is an example of its work (by the way, I'm not sure who exactly did the autocompletion: Copilot or Xcode predictive code completion model, they pretty much work the same)
That's all, if anyone was thinking about installing it, here's my conclusion: if you're working with GPT or other AIs, I don't see much sense in it (especially if you enable Xcode predictive code completion model). But you can play around with it, although it often confuses and adds what is not needed.
As usual, catch the video on this topic in TG: https://t.me/NataWakeUp/681
Write comment