As iOS engineers, we love clean code. We love it even more when someone points out how to improve it, as long as that “someone” doesn’t start with “Bro, just use MVVM.”
So, when I decided to build a Podcast App’s Home Screen using SwiftUI, I thought, what if I let AI take the driver's seat instead of bothering a colleague for code review?
So I tested CodeRabbit, an AI-powered tool that claims to review your pull requests as if a senior engineer is peeking over your shoulder.
This article is a journal of what I built, the code I wrote, what the AI said, and how I improved, sometimes reluctantly, often impressed.
Table of Contents
- What I was Building
- Building HomeView Layout
- What happened when I raised a Pull Request
- Feedback #1: File Name vs Struct Name
- Feedback #2: Add Empty State Handling
- Introducing known Errors to SwiftUI App
- CodeRabbit Conclusion
What I was Building
The goal was simple: build the Home Screen for my podcast app, “Curious”, with a featured section, categories, and a recent episodes list.
Think a scrollable screen with smart layouts, animations, and a responsive design using the latest SwiftUI APIs from iOS 17 and 18.
Before I get roasted, yes, I used ScrollView instead of List. And no, I don’t regret it.
Building HomeView Layout
Let’s start with the first version I pushed to GitHub:
struct HomeView: View { var body: some View { ScrollView { VStack(alignment: .leading, spacing: 24) { FeaturedPodcastCard() PodcastCategoriesView() RecentEpisodesView() } .padding(.horizontal) } .navigationTitle("Listen Now") } }I divided each section into smaller views to keep the code readable.
Let’s give you a walkthrough of each of the small views.
Here's a peek into FeaturedPodcastCard:
Here's a peek into PodcastCategoriesView:
Here's a peek into RecentEpisodesView:
I committed this, raised a PR, and… waited for a few seconds.
Just kidding. CodeRabbit responded within seconds.
What happened when I raised a Pull Request
As soon as I opened the PR to main branch, titled:
"Home view - Featured, Podcast Categories and Recent Episodes View"
CodeRabbit immediately kicked in with:
- A summary and walkthrough of changes - ideally great for other reviewers to look at
- A sequence diagram of changes in the project
- A breakdown of the commits and affected files
- And a line-by-line code review
Now, let’s look at some of the best feedback I received from CodeRabbit.
Feedback #1: File Name vs Struct Name
One of the first suggestions:
"The file is named FeaturedPostCardView.swift but contains struct FeaturedPodcastView. Rename the file or the struct for consistency."
This is something that easily slips during quick development. But CodeRabbit flagged it instantly. Clean code starts with clear conventions, and this was a helpful nudge.
Feedback #2: Add Empty State Handling
In RecentEpisodesView.swift, I had written a loop to render episodes like this:
ForEach(episodes) { episode in RecentEpisodeRow(episode: episode) .padding(.horizontal) }CodeRabbit jumped in again:
"The current implementation doesn't handle the case when there are no episodes to display."
It suggested adding a conditional check:
if episodes.isEmpty { Text("No recent episodes found") .italic() .foregroundColor(.secondary) .padding(.horizontal) .padding(.top, 8) } else { ForEach(episodes) { episode in RecentEpisodeRow(episode: episode) .padding(.horizontal) } }Though it tracked all the possible improvements and issues, this was quite simple to track.
Now, I want to introduce patterns or code constructs that typically require nuanced human attention. This will test the limits of CodeRabbit review and help me decide whether to use it daily in the workflow.
Introducing known Errors to SwiftUI App
The systemImage in Category model is made optional and while unwrapping the value of this object I’ll use force unwrap.
Expectation: CodeRabbit should suggest using if let, optional binding, or nil coalescing.
Reality : To my surprise, it actually spotted the correct context of the problem and suggested nil coalescing to solve this potential problem.
Let’s try one more thing, complex view nesting.
I’ll create the HomeView deeply nested in VStack, HStack and ZStack.
Expectation: CodeRabbit should break it into smaller subviews.
I didn’t find the review, but discovered that the CodeRabbit free plan has a rate limit.
Let’s see what the results are:
Reality: CodeRabbit suggested refactoring the code and reducing over nesting of views. Now its code solution may not be as per expectations but it found the issue, that’s enough.
CodeRabbit Conclusion
I didn’t expect to conclude it this way. CodeRabbit first caught things I would’ve likely cleaned up weeks later (if at all). But the game changer was the issues that I explicitly planted. I expected CodeRabbit to fail on those checks, but to my surprise, it passed with flying colors.
While reading the code reviews, I realised that CodeRabbit has also introduced a new feature.
CodeRabbit now has plugins for VSCode, Cursor, and Windsurf. I expect that they will also bring something similar for iOS developers.
If you're building SwiftUI interfaces, especially alone or in a small team, letting CodeRabbit handle code reviews can:
- Save time
- Improve consistency
- Encourage better habits
It’s not replacing human reviewers. But it’s like having one always available. So next time you push to the main, let the rabbit hop in first. You might learn something new.