I Built an IOS App in 3 Days with Literally No Prior Swift Knowledge


the Brush Tracker app in 3 days with no prior experience with Swift, the main programming language for iOS development. Although I have a fully functional app live on the App Store, I still have very little Swift knowledge because I used “vibe coding” to develop this app.

In this article, I’ll explain the process, AI tools I used, and share some of my learnings and insights.

Anything as Lovable alternative

I previously used Lovable for developing web applications but it doesn’t seem to be an option for mobile app development, at least for now.

There are alternatives to Lovable for app development. I recently came across a tool called Anything, and since I’d had such a good experience with Lovable, I decided to give it a try to develop my app. At first, it seemed to work well, but the overall experience wasn’t as efficient as I’d hoped.

The hardest part was not being able to test my changes, fixes, and improvements right away. Anything does have a built-in UI for testing, but the experience wasn’t very smooth. It also directs you to test the code through the Expo app, but that didn’t work well for me either.

I should mention that I did not have any prior app development experience. For developers or anyone with some coding background, Anything could probably be a more productive tool than it was for me.

I exported the code from Anything and tried to test it on Xcode on my mac but got many errors and could not get it to working. So I decided to use an alternative. Cursor seemed to the obvious choice.

Cursor

I’ve heard very good things about Cursor from many friends who are actively using it. I wanted to give it a try myself.

I used the same prompt in Cursor and asked it to build the app. Then I created an XCode project with the folders and files generated by Cursor. I started the simulator on XCode and it worked on the first try.

The goal of Brush Tracker is to help you stay consistent with your daily toothbrushing. It gives you a cleanliness score that starts at 100%. If you skip a day, the score drops and your teeth in the app start to look a bit yellowish to match the cleanliness score.

Note: All images used in this article include screenshots from my app, Brush Tracker.

The first version only had the main feature of the app. I think this is the most efficient way of building products with AI-based tools. Get the first version up and running before adding features.

To test the app’s core feature on the simulator, I had to change the simulator’s date without completing “today’s brushing” to check whether the cleanliness score would drop and the teeth visualizations would update as expected.

Cursor suggested to change the date on the XCode simulator but the simulator does not have the date and time settings anymore. Older versions of XCode simulator had this setting but not anymore.

A workaround solution was to change the date on my Mac. This way, the date on the simulator also changed and I was able to test the feature.

One thing I noticed was that when I changed the date on my Mac, Cursor did not see my account and did not work. It got back to normal when I changed the date back to auto.

Timer feature

A built-in brushing timer felt like the great addition to Brush Tracker. Users can simply mark a brushing session as done or use the timer while they brush.

It took me a few tries to get this feature working the way I imagined. You can just tell Cursor to add a feature, but it works much better when you tweak the prompt and explain exactly what you want. Once you give clear instructions, Cursor usually does a great job.

Reward feature

I wanted to add an extra motivation when the user completes daily brushings. After completing the sessions, they can tap “Get Your Daily Reward” and see a short motivational quote. It’s a small touch but a nice reminder for dental health.

You can actually learn while vibe coding

Cursor not only writes the code but also helps you learn. When I was trying to add the reward feature, the implementation was not correct at first. It wasn’t working properly.

I described the issue to Cursor, and it explained both what was causing the problem and how to fix it. Here are two examples of how Cursor can help you learn along the way:

The issue is that rewardQuote is empty on the first tap because handleRewardTap() sets it, but the sheet is presented immediately. I need to ensure the quote is set before showing the sheet.

Fixed the issue! The problem was that showReward = true was being set immediately after rewardQuote, but SwiftUI’s sheet presentation can happen before the state update is fully processed.

Use Cursor more efficiently

Cursor is a great tool but there are some ways to make it more efficient.

Let’s assume code fails or it doesn’t execute correctly. If you know the problematic part, highlight that section and add to the chat. It definitely makes it easier for Cursor to fix problem.

In Brush Tracker, I was having a problem when setting up notifications. I defined the problem and asked Cursor to fix it. Cursor told me it was fixed but the problem still existed. Then, from the code changes I found where the problem was occurring and added that part to the chat.

Cursor fixed it on the next try: The problem is that the onTapGesture is applied to the Picker, but in SwiftUI, segmented pickers don’t always respond well to tap gestures because they have their own internal gesture handling. The onChange modifier only triggers when the selection actually changes, not when the same value is tapped.

Another thing worth mentioning is the “context used” percentage in Cursor. It automatically captures relevant context from your codebase, so you don’t have to tell it which files to look at. But your chat history is also included in that context, and sometimes it contains old problems or irrelevant code.

That extra clutter can increase token usage or make Cursor less efficient. When the context used percentage increases, I clear the chat history.

Distributing your app in the App Store

Once you complete testing your app using the simulator or a physical device (e.g. your own iPhone), it’s time to distribute your app in the App Store so that others can see (and hopefully use) your app.

It’s not a complicated process but there are a lot of details, which might take long especially when you’re doing it for the first time. I found a video on YouTube that clearly explains the entire process step by step.

After completing all the steps, I submitted my app for review. Once it was approved, I got an email from App Store Connect letting me know it was ready for distribution.

I’d like to point out that I don’t have any affiliation with any of the AI tools mentioned in this article.

Thanks for reading! You can check out Brush Tracker on the App Store. I’d love to hear from you if you try it or have any feedback.



Source link

The post I Built an IOS App in 3 Days with Literally No Prior Swift Knowledge first appeared on TechToday.

This post originally appeared on TechToday.

Leave a Reply

Your email address will not be published. Required fields are marked *