The Rise of 'Build Once, Run Everywhere' SwiftUI Apps
Developers are increasingly using SwiftUI and SwiftData to build robust, multiplatform apps from a single source of truth. This declarative approach is dramatically reducing code duplication and enabling teams to ship features across iOS, iPadOS, and macOS more efficiently.
SwiftUI was first announced at WWDC in 2019, representing a fundamental shift from Apple's longstanding imperative UI framework, UIKit, which dates back to the first iPhone SDK. The older frameworks like UIKit and AppKit, built for Objective-C, required developers to use separate codebases for platforms like iOS and macOS. The core change is the move to a declarative syntax, where developers describe what the UI should look like for a given state, rather than writing step-by-step instructions to update it. This approach can significantly reduce boilerplate, with some studies showing up to a 40% reduction in code size and a 36.8% decrease in development time compared to an equivalent UIKit implementation. Introduced at WWDC 2023, SwiftData is built on top of the powerful Core Data framework but exposes a modern, Swift-native API. It integrates directly with SwiftUI through property wrappers like `@Query`, allowing the UI to reactively update as data changes with minimal code, a stark contrast to the manual setup required by Core Data. While Apple previously offered Mac Catalyst as a way to port iPad apps to the Mac, SwiftUI was engineered from the ground up as a unified framework for all Apple platforms. This now includes iOS, iPadOS, macOS, watchOS, tvOS, and even visionOS for building spatial computing experiences. Adoption has grown rapidly, with surveys in 2025 indicating that roughly 70% of new apps are built using SwiftUI. However, UIKit remains dominant in legacy systems, powering around 80% of existing enterprise apps. This has led to the common practice of incrementally adopting SwiftUI by embedding new views within established UIKit applications. A key productivity enhancer is Xcode's live preview canvas, which displays UI changes in real-time without needing to build and run the entire application. This feature, combined with the more concise code, accelerates the development and iteration process for building user interfaces. Apple's investment is clear, with the number of system binaries using SwiftUI in iOS increasing by 50% between iOS 16 and iOS 17. Each major OS release has brought significant enhancements, such as the Charts framework in iOS 16 and advanced animation capabilities in iOS 18.