AI-Assisted Development for iOS

Jul 18 2025 · Swift 6.1, iOS 18, Xcode 16.3

Lesson 01: Using Chat-based LLMs for iOS Development

Duelling AIs

Episode complete

Play next episode

Next
Transcript

So we left last time having looked at creating a software specification using ChatGPT. And now we are going to take that software specification and ask Google Gemini whether this is a good software specification. What questions do you have if you are going to implement it?

This is quite a helpful technique. That is exactly what you would do in the real world, right? You would pass it around your different engineers and your team and get some feedback. Actually, AI is quite good at this as well. It’ll also give us an opportunity to take a look at using Google Gemini inside AI studio, which I think is a really helpful workhorse tool for working on documents like this.

So first up, we will jump back to our ChatGPT thing. And as a document here, I’m going to copy the contents of that document. You’ll be able to find this inside the materials repo.

I’m going to go over to open AI studio. Google. So that is just aistudio.google.com. Once again, there’s a selection of different models that you can use. I’m using the flash preview flash is the cheapest. You get a certain amount of free access to these before you have to pay.

I’m going to start with a chat prompt saying I have a soft spec. I would like you to take a look at it with a view to implementing it. And let me know if you have any questions relating to that, and then I’m going to paste in the specification, and then I’m going to run it.

And if it goes it’s going to have a think.

Okay. So it thinks it’s got a fairly reasonable document specification. I think the thing to bear in mind with all of these is that it quite often tells you that what you have done is good. Because who doesn’t like hearing that what they’ve done is good?

So some questions for clarification. There’s a few of those here. So for example, best location available. How long should it attempt? What’s the expected user experience if the denies location access? They’re really good questions.

There’s some understanding about what time zone auto does the same. Units questions? What should the loading state look like once these questions are addressed?

So we could go through and address those questions. But what I’m going to do is I’m going to copy these questions for clarification. I’m going to copy them and go back to ChatGPT and say, “I have some questions for you to clarify. Please can you address and update the spec.” And paste them in. And then we’ll leave it a moment and see how it goes.

And this, we should say, is starting to address some of those questions. So, for example, it should attempt for five seconds. If it can’t, it will fall back to less accurate. If you deny the access, then show a message explaining that it cannot function without the location, and guide the user to settings to enable it so that there is a answers.

One of the questions that came up inside Google AI studio. And now I am going to do exactly the same again. Not sure I’m going to copy this. I’m going to take it back to my Google Studio and say “I have addressed those issues. Could you take another look, please?” I’m going to paste that in again and off it goes.

And whilst we wait for that, it’s going to, it’s analysing the clarifications. You can see that you’re using tokens and I have just over a million tokens. I don’t honestly know how often this refreshes resets. Something to do with our Google account, but at least you’ve got a good idea of how much you’re spending. As it were.

The updated spec is excellent. Well, of course it is. You’ve addressed them all. Quick summary of how the points are being clarified. Conclusion. So there is nothing. There has no further questions regarding the spec. So we can say that the spec that we’ve created is pretty good.

For in order to if it was to read it, I would highly suggest at this point that we go and read that spec. But let’s say for a second that we didn’t want, that we had read it and we were happy with it. What else can you do with Google Studio?

Well, let us take a little look here. One of the things that is asking for. And it’s going to, it mentions that it thinks we should have a location manager module.

Now, you can ask Google Studio to write some code. So please, could you give me some sample Swift six code for the location manager module. I really want sample codes. Please. Could you give me implementation annotation in Swift six for the location manager module and then go with that?

So it’s looked here. It’s decided that it should use modern swift concurrency. Async await. Because we’re using Swift six, it talks about the things that it’s done and it’s then created some code. It’s created a location error. It’s created the location manager class. This CLLocationManagerDelegate. All of these things. If you’ve worked with locations in iOS in the past, you’ll kind of recognise.

So what we could do at this point is, oh, and then it gives you down here some instructions on what to do. So for example, we need to add the privacy description to info.plist. That’s the thing where it asks you why do you want to use this location. What’s the justification. So it’s asking you for that.

And then you’ve it’s so you’ve you’ve added this class into your Swift project, and then it tells you roughly what you could do to create a swift view.

So, like this is given us a lot. There’s a lot of code here, but you can imagine that writing out your questions in this way, and getting code written out in a web browser like this, and having to copy and paste it to Xcode is quite a lot of pain, particularly if you’re working on a larger project.

It also has no context of the other things that are already in your project. So you’re just asking for standalone modules, and if we as we start to realise that it can’t write magical code to start with, then it will have some problems.

So what do we do about those problems? And our next lesson, we’re going to look at how we can integrate AI directly with Xcode using a tool from GitHub. And we’ll see for that next time.

Thank you.

See forum comments
Cinema mode Download course materials from Github
Previous: Google AI Studio Next: Conclusion