Apple platform checks in public Swift files
23 platform, visionOS, watchOS and CarPlay words counted in public Swift files on 1 November 2026.
Free for one project and 100 votes. Paid plans start with a 14 day trial, no card.
The top ten
os(iOS) and os(macOS) lead, each in about 155,000 files.
| Word | Files |
|---|---|
| os(iOS) | 155,648 |
| os(macOS) | 154,880 |
| os(tvOS) | 62,720 |
| canImport(UIKit) | 57,344 |
| os(watchOS) | 41,088 |
| canImport(AppKit) | 22,272 |
| import RealityKit | 21,760 |
| targetEnvironment(macCatalyst) | 20,224 |
| import WatchKit | 16,416 |
| os(visionOS) | 15,680 |
Platform checks
os(iOS) is in 9.9 times the files of os(visionOS).
| Platform check | Files |
|---|---|
| os(iOS) | 155,648 |
| os(macOS) | 154,880 |
| os(tvOS) | 62,720 |
| canImport(UIKit) | 57,344 |
| os(watchOS) | 41,088 |
| canImport(AppKit) | 22,272 |
| targetEnvironment(macCatalyst) | 20,224 |
| os(visionOS) | 15,680 |
Against imports
canImport(UIKit) is in 2.0 files per 100 that import UIKit.
canImport(AppKit) is in 4.2 files per 100 that import AppKit.
| Word | Files |
|---|---|
| import UIKit | 2,879,488 |
| canImport(UIKit) | 57,344 |
| import AppKit | 530,432 |
| canImport(AppKit) | 22,272 |
visionOS
import RealityKit is in 1.4 times the files of os(visionOS).
| visionOS word | Files |
|---|---|
| import RealityKit | 21,760 |
| ImmersiveSpace | 6,040 |
| RealityView | 4,528 |
watchOS
import WatchKit is in 16,416 files, the most of the watchOS words.
| watchOS word | Files |
|---|---|
| import WatchKit | 16,416 |
| WCSession | 11,136 |
| import WatchConnectivity | 10,000 |
| import ClockKit | 1,708 |
| WKApplicationDelegate | 804 |
Apple TV and CarPlay
import CarPlay is in 9.5 times the files of import TVUIKit.
CPTemplateApplicationSceneDelegate is in 518 files and TVTopShelfContentProvider in 218.
| tvOS and CarPlay word | Files |
|---|---|
| import CarPlay | 1,972 |
| CPTemplateApplicationSceneDelegate | 518 |
| TVTopShelfContentProvider | 218 |
| import TVUIKit | 208 |
Health and motion
HKHealthStore is in 8.0 times the files of HKWorkoutSession.
HKHealthStore is in 2.2 times the files of CMMotionManager.
| Health and motion word | Files |
|---|---|
| HKHealthStore | 12,272 |
| CMMotionManager | 5,688 |
| HKWorkoutSession | 1,534 |
By group
Across all 23 words the spread is 748 to 1.
The watchOS group spreads 20 to 1, the widest of the five.
The platform checks spread 9.9 to 1 and the health group 8.0 to 1.
| Group | Most | Fewest |
|---|---|---|
| Platform checks | 155,648 | 15,680 |
| visionOS | 21,760 | 4,528 |
| watchOS | 16,416 | 804 |
| tvOS and CarPlay | 1,972 | 208 |
| Health and motion | 12,272 | 1,534 |
What is in the file
A count for each word
8 platform checks and 15 words for visionOS, watchOS, tvOS, CarPlay and health.
Checks set against imports
Each framework check beside the files that import the framework.
Ratios you can quote
os(iOS) is in 9.9 times the files of os(visionOS).
No code and no names
The file holds counts only, with no repository and no developer.
How the files were counted
One search per word.
Write 23 searches
Each search names one platform check or framework word, matched in Swift files.
Ask the code search
One request per search, with at least seven seconds between requests.
Repeat an incomplete answer
Results the service marked as incomplete were fetched again, three times at most.
Keep the count
Each CSV row pairs a word with its count and its search, and no code.
Which platforms a package has to cover
Supporting iOS and macOS reaches the bulk of the code counted here: 155,648 files test for the first and 154,880 for the second. The next platforms are far behind, with os(tvOS) in 62,720 files, os(watchOS) in 41,088 and os(visionOS) in 15,680.
Code that has to compile for both UIKit and AppKit guards the difference with canImport, written in 57,344 files for UIKit and 22,272 for AppKit. A board built in SwiftUI keeps those guards to the few places where sharing, mail or windows differ between the two.
What these numbers leave out
- These are files and not apps or users.
- Rounded results come back for large counts, so words that sit within 10 percent of each other are level.
- A platform check can sit in a file that targets one platform only, and a word in a comment counts too.
- RealityKit, WatchKit and CarPlay words also appear in sample code, and a copied sample counts each time.
- The search leaves out most forks. No code was read.
Swift multiplatform questions
Do more Swift files check for iOS or macOS?
They are level: os(iOS) is in 155,648 files and os(macOS) in 154,880.
How much Swift code checks for visionOS?
os(visionOS) is in 15,680 files, and import RealityKit in 21,760.
How common is a check for watchOS?
os(watchOS) is in 41,088 files, and import WatchKit in 16,416.
Is a Mac Catalyst check common?
targetEnvironment(macCatalyst) is in 20,224 files, 13.0 for every 100 with os(iOS).
How many files use CarPlay?
import CarPlay is in 1,972 files, 9.5 times import TVUIKit.
How many files use the health store?
HKHealthStore is in 12,272 files, 8.0 times HKWorkoutSession.
How common is a check for the UIKit framework?
canImport(UIKit) is in 57,344 files, 2.6 times canImport(AppKit) with 22,272.
Is Apple TV or Apple Watch checked more?
os(tvOS) is in 62,720 files and os(watchOS) in 41,088, which is 1.5 times.
Which watchOS word is in the most files?
import WatchKit, in 16,416 files, ahead of WCSession with 11,136.
Does this count apps?
No. It counts files, and a copied sample counts each time.
Does the file hold any code?
No. It holds a count and the search for each word.
May a site quote these figures?
Yes. Any figure may be quoted with a link back to this page and the count date, 1 November 2026.
More Swift code, counted
More counts for Swift and iOS developers.
SwiftUI vs UIKit and 22 more Apple frameworks, counted
24 Apple frameworks counted in public Swift files.
Widgets, Live Activities and App Intents in Swift files
22 words counted in public Swift files.
SwiftUI views and modifiers counted in public Swift files
19 SwiftUI words counted in public Swift files.
Which platforms and Swift versions Swift packages build on
1,367 sampled packages, from iOS to Linux and Android.
Sign in, Face ID and push counted in Swift apps
16 sign in, Face ID and push words counted.
Mac menu bar, login item and system access code counted
14 menu bar, login item and system words counted.
Collect feature requests in an iOS app
Your first board is free, with one project and 100 votes. The 14 day trial of Lite or Pro needs no card.