Swift code statistics: SwiftUI in 3,190,784 files
Forty numbers from Swift code, packages and Xcode releases with each count sourced.
Free for one project and 100 votes. Paid plans start with a 14 day trial, no card.
Screens
Eight numbers on frameworks, new calls and the views that code reaches for most.
SwiftUI is in 3,190,784 files and UIKit in 2,879,488, and withAnimation leads the views.
SwiftUI and UIKit are level, and the newer calls still trail the old ones.
| Statistic | Number |
|---|---|
| Files importing SwiftUI | 3,190,784 |
| SwiftData over Core Data | 1.4 to 1 |
| Files importing Foundation | 5,808,128 |
| NavigationStack share | 64.2 in 100 |
| Swift Testing share | 32.2 in 100 |
| Files with @MainActor | 1,282,048 |
| Files with withAnimation | 308,736 |
| Files with NavigationLink | 223,488 |
Concurrency
Eight numbers on concurrency words, older callbacks and the names of app layers.
nonisolated is in 365,056 files, and ViewModel in 903,168 against 349,696 for Repository.
The new concurrency words lead, and the old dispatch calls are far from gone.
| Statistic | Number |
|---|---|
| Files with nonisolated | 365,056 |
| Files with Task.sleep | 355,840 |
| Files with asyncAfter | 268,800 |
| Completion handler files | 243,968 |
| Combine over Rx bag | 1.7 to 1 |
| ViewModel files | 903,168 |
| Repository files | 349,696 |
| Reducer files | 60,416 |
Data and tests
Eight numbers on storage, JSON, logging and test words in public files.
FileManager.default is in 696,320 files, and XCTestCase in 1,222,656.
Plain file storage and the older test case still lead.
| Statistic | Number |
|---|---|
| FileManager.default files | 696,320 |
| UserDefaults.standard files | 310,784 |
| ModelContainer files | 85,760 |
| JSONDecoder() files | 531,456 |
| JSONSerialization files | 358,789 |
| XCTestCase files | 1,222,656 |
| Logger files | 96,128 |
| MetricKit import files | 1,038 |
Packages
Eight numbers on stars, licenses, upkeep and builds across public Swift packages.
80.5 in 100 packages use MIT or Apache-2.0, and 16.8 in 100 reach 100 stars.
Most packages are small, and a few hold nearly all the stars.
| Statistic | Number |
|---|---|
| Packages on the list | 12,422 |
| Median package stars | 6 stars |
| Packages with 100 stars | 16.8 in 100 |
| Archived packages | 5.4 in 100 |
| Pushed in 12 months | 52.2 in 100 |
| MIT or Apache-2.0 | 80.5 in 100 |
| No license or unmatched | 14.3 in 100 |
| Packages building on iOS | 86.2 in 100 |
Language and tools
Eight numbers on language modes, proposals, Xcode releases and minimum versions.
91.5 in 100 project files set Swift 5, and 64.0 in 100 new ones target iOS 18.
Projects move to new targets faster than to a new language mode.
| Statistic | Number |
|---|---|
| Swift 5 language mode | 91.5 in 100 |
| Swift 6 in format 77 | 6.9 in 100 |
| Proposals implemented | 82.1 in 100 |
| Swift 3.0 proposals | 89 |
| Majors shipped in September | 12 of 12 |
| Median gap, Swift to Xcode | 179 days |
| New files targeting iOS 18 | 64.0 in 100 |
| Package floor of iOS 15 | 22.7 in 100 |
What is in the file
Forty numbers in one file
One row each: the number, its unit and the guide that holds the count.
Five groups
Screens, concurrency, data and tests, packages, and language and tools.
No package names
The file holds counts, so it names no package, author or app.
A way to cite it
Use any figure or the whole file, and credit this page and the read date.
Where the numbers come from
Four steps.
Search the code
Public Swift files were searched for each framework, call and attribute named in a guide.
Read the packages
Public Swift packages were read for stars, licenses, platforms and settings.
Count in the guides
Each guide counted one family of words or settings, with its own sample and read date.
Collect the headlines
The forty headline figures were lifted from the guides and checked against each page.
What a new package joins
A package that draws a board joins projects where NavigationStack is in 64.2 of every 100 files that use it or NavigationView, and where view models are in 903,168 files. Offering the board as a view and its state as a separate model lets an app place it inside its own screen.
Tests are still mostly XCTest, with Swift Testing in 32.2 of every 100 files that use either. Among 12,422 packages on the list, 52.2 in 100 had a push in the last 12 months and the median has 6 stars, so a package that ships regular releases stands out.
What these numbers leave out
- The code counts come from public files that a code search returned, so private code is not in them.
- A code search count is rounded, so a gap of a few percent between two words can be noise.
- The package numbers come from public lists, and the sample is smaller for the build checks.
- A word in a file shows that it is used, and it does not show how much or how well.
- Any figure here is only as firm as the guide it was lifted from.
- Code and packages change every day, so each guide gives its own read date.
- The page names no package or author, so each number is tied to a group of files or packages.
What people ask about launch numbers
Is SwiftUI used more than UIKit?
SwiftUI is imported by 3,190,784 public files and UIKit by 2,879,488, so SwiftUI leads by 1.1 to 1.
Is SwiftData replacing Core Data?
Not yet. SwiftData is imported in 244,736 files against 172,032 for Core Data, which is 1.4 to 1.
How much Swift code uses Swift Testing?
Swift Testing has 32.2 of 100 files that import either test library.
Do files still use dispatch queues?
Yes. asyncAfter is in 268,800 files, against 355,840 for Task.sleep.
How common is the ViewModel name?
It is in 903,168 public files, 2.6 times as many as Repository.
Which license do Swift packages use?
MIT and Apache-2.0 together cover 80.5 in 100 packages.
How many Swift packages get 100 stars?
16.8 in 100, and the median package has 6 stars.
Which Swift version do projects set?
Swift 5 is set in 91.5 in 100 project files, and Swift 6 in 6.9 in 100 of the newer format.
Which iOS version do new projects target?
iOS 18 is set in 64.0 in 100 new project files, and iOS 26 in 28.3.
May a page quote these figures?
Yes, with this page named and the read date. The 40 rows of swift-code-statistics-2026-10.csv hold every figure behind it.
Read the guides
Each number links back to its source.
SwiftUI against UIKit and 22 more frameworks, counted
SwiftUI views and modifiers counted in public files
NavigationStack, Observable and Swift Testing, counted
How much Swift code uses concurrency, queues and Combine?
ViewModel, Coordinator and Reducer counted in files
SwiftData, Core Data and CloudKit counted in files
URLSession, Codable and Network counted in files
How Swift apps log, crash and test, counted
Show 8 more
Swift package licenses: MIT, Apache-2.0 and none
What Swift packages with many stars have in common
Swift packages in 2026: stars, pushes and setup
Which platforms and Swift versions packages build on
Swift Evolution proposals: 560 counted by status
Swift 6, strict concurrency and Xcode versions counted
Xcode release history: dates, Swift and macOS needed
Minimum iOS versions in 85,504 new projects
Readers who tell you what to build
Your first board is free, with one project and 100 votes. The 14 day trial of Lite or Pro needs no card.