Swift Development for iOS Apps: What Good Code Actually Looks Like in 2026

Good Swift code in 2026 means Swift 6 strict concurrency compiled clean, not silenced. Views stay thin, view models are @MainActor and @Observable, shared state crosses actors only through Sendable types, and there's no DispatchQueue.main.async sprinkled around. If it compiles without warnings, it's probably maintainable.
Part of the complete app development guide.
On this page
- Swift 6 and strict concurrency are no longer optional
- Architecture: pick something boring and stick to it
- Persistence: SwiftData has matured, but know its edges
- Testing that actually catches bugs
- Performance is usually a data problem, not a rendering problem
- The business side nobody puts in the tutorial
- FAQ
- Should I use SwiftUI or UIKit in 2026?
- Is Swift 6 strict concurrency going to break my existing app?
- How much does it cost to maintain an iOS app per year?
Most Swift codebases don’t fail because the developers were lazy. They fail because someone shipped a version that worked and nobody went back to fix the structure. I’ve been writing Swift since the pre-SwiftUI days, and the gap between “it compiles and the app runs” and “this is maintainable in two years” is where most projects quietly go wrong.
Here’s what actually matters if you’re building or maintaining an iOS app right now.
Swift 6 and strict concurrency are no longer optional
Swift 6 shipped with strict concurrency checking on by default, and by 2026 the ecosystem has largely caught up. If you’re still writing code that mutates shared state from a detached task and hoping the compiler doesn’t notice, you’re going to have a bad time. The compiler notices now.
The practical shift is that @MainActor and Sendable have to be intentional, not sprinkled in as a fix. A view model that touches UI state should be main-actor isolated. Anything crossing actor boundaries needs to be genuinely safe to send.
@MainActor
@Observable
final class ArticleListViewModel {
private(set) var articles: [Article] = []
private(set) var isLoading = false
private let service: ArticleService
init(service: ArticleService) {
self.service = service
}
func load() async {
isLoading = true
defer { isLoading = false }
do {
articles = try await service.fetchAll()
} catch {
articles = []
}
}
}
Notice there’s no DispatchQueue.main.async anywhere. That pattern is legacy. With async/await and actor isolation, you don’t need it, and reaching for it usually means you’ve lost track of which context you’re in.
Architecture: pick something boring and stick to it
The biggest waste of money I see on iOS projects is architecture churn. A team starts with MVVM, reads about The Composable Architecture six months in, rewrites half the app, then reads about something else. Nobody ships.
You don’t need a trendy pattern. You need one that separates concerns and that your team can actually follow. For most apps, that means:
- Views that render state and forward user intent. Nothing else.
- View models or observable models that hold screen state and coordinate work.
- A service or repository layer that owns networking, persistence, and anything with side effects.
- Plain Swift models that don’t know about SwiftUI, networking, or the database.
That’s it. Four layers. MVVM with a repository is unglamorous and it works. If your app grows into something that genuinely needs a reducer-based architecture, you’ll know because you’ll feel the specific pain it solves, not because a blog post told you to.
Persistence: SwiftData has matured, but know its edges
SwiftData has been the default recommendation for new apps for a while now, and the rough edges from the early releases are mostly gone. It’s genuinely pleasant for straightforward object graphs.
@Model
final class Article {
var title: String
var publishedAt: Date
var body: String
init(title: String, publishedAt: Date, body: String) {
self.title = title
self.publishedAt = publishedAt
self.body = body
}
}
Where people get burned is treating it like a magic layer. Two things to keep in mind:
- Migrations need planning. Schema changes are coming. Set up a versioned schema and a migration plan from day one, even if you only have one version. Adding it later is painful.
- Background work needs its own context. Don’t pass a main-context model into a background task. Use a model actor or a separate
ModelContextand pass identifiers, not objects.
If your data layer is genuinely complex (heavy sync, conflict resolution, lots of relational queries), Core Data is still a legitimate choice in 2026. It’s older, but it’s not dead, and the tooling around it is deep.
Testing that actually catches bugs
Unit tests on view models are cheap and worth it. UI tests are expensive and flaky, and most teams over-invest in them. The sweet spot for a typical app:
- Unit test your view models with a fake service. Fast, no simulator, catches real logic bugs.
- Unit test your networking layer’s decoding with fixture data. This catches the API contract break before your users do.
- Keep a small handful of UI tests for critical flows only: login, checkout, whatever the app exists to do.
Swift Testing has replaced XCTest for most new test code, and the syntax is cleaner. If you haven’t moved over, it’s a low-risk migration that pays off in readability.
Performance is usually a data problem, not a rendering problem
When an iOS app feels slow, the instinct is to blame SwiftUI. Usually it’s not SwiftUI. It’s one of these:
- Fetching far more data than the screen needs. Paginate.
- Doing expensive work in a view body. Move it out.
- Decoding JSON on the main thread. It’s async; use it.
- Images loaded at full resolution and scaled down in the view. Resize before display.
Profile with Instruments before you optimize anything. Guessing at performance is how you spend a week making something faster that was never the bottleneck.
The business side nobody puts in the tutorial
An iOS app is not a one-time build. It’s a subscription to Apple’s yearly release cycle, plus whatever backend it talks to, plus the App Store review process, which will reject you for reasons that feel arbitrary and are usually about a guideline you didn’t read. Budget for maintenance. A codebase that’s clean and tested costs far less to keep alive than one that isn’t, and that difference compounds every single year.
I build and maintain iOS and web software out of Commack, and the pattern holds whether it’s a small internal tool or a consumer app with real users. If you’re weighing a native app against a web approach, it’s worth reading up on custom web development as a comparison point, because for a lot of businesses the web version ships faster and reaches more people. Native makes sense when you need device capabilities, offline behavior, or a presence in the App Store. Otherwise, be honest about why you want it.
FAQ
Should I use SwiftUI or UIKit in 2026?
SwiftUI for new apps, unless you have a specific requirement it handles poorly (some complex text editing, certain map or camera flows). UIKit isn’t going anywhere and you can mix them, but starting a new app in pure UIKit today is hard to justify.
Is Swift 6 strict concurrency going to break my existing app?
Not all at once. You can adopt it module by module and use Swift 5 language mode in the interim. The migration is real work, but it surfaces genuine threading bugs, so it’s worth doing deliberately rather than avoiding forever.
How much does it cost to maintain an iOS app per year?
It depends entirely on the codebase and how much the app does. A well-structured app might need a few days a year for OS updates and dependency bumps. A messy one can eat weeks, plus whatever new features you want. The maintenance cost is set by the quality of the original code, which is the whole argument for writing it properly the first time.


