Skip to content
GuidesChecked 20 November 2026

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.

Swift files, the ten most common words
WordFiles
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 RealityKit21,760
targetEnvironment(macCatalyst)20,224
import WatchKit16,416
os(visionOS)15,680

Platform checks

os(iOS) is in 9.9 times the files of os(visionOS).

Swift files by platform check
Platform checkFiles
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

Per 100 os(iOS)

canImport(UIKit) is in 36.8 files per 100 with os(iOS), os(watchOS) in 26.4 and canImport(AppKit) in 14.3.

os(tvOS) is in 40.3 files for every 100 with os(iOS).

targetEnvironment(macCatalyst) is in 13.0 and os(visionOS) in 10.1.

Swift files per 100 with os(iOS)
Platform checkPer 100
os(macOS)99.5
os(tvOS)40.3
canImport(UIKit)36.8
os(watchOS)26.4
canImport(AppKit)14.3
targetEnvironment(macCatalyst)13.0
os(visionOS)10.1

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.

Import counts beside the check counts
WordFiles
import UIKit2,879,488
canImport(UIKit)57,344
import AppKit530,432
canImport(AppKit)22,272

visionOS

import RealityKit is in 1.4 times the files of os(visionOS).

Swift files by visionOS word
visionOS wordFiles
import RealityKit21,760
ImmersiveSpace6,040
RealityView4,528

watchOS

import WatchKit is in 16,416 files, the most of the watchOS words.

Swift files by watchOS word
watchOS wordFiles
import WatchKit16,416
WCSession11,136
import WatchConnectivity10,000
import ClockKit1,708
WKApplicationDelegate804

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.

Swift files by Apple TV and CarPlay word
tvOS and CarPlay wordFiles
import CarPlay1,972
CPTemplateApplicationSceneDelegate518
TVTopShelfContentProvider218
import TVUIKit208

Health and motion

HKHealthStore is in 8.0 times the files of HKWorkoutSession.

HKHealthStore is in 2.2 times the files of CMMotionManager.

Swift files by health and motion word
Health and motion wordFiles
HKHealthStore12,272
CMMotionManager5,688
HKWorkoutSession1,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.

Swift files, the most and the fewest of each group
GroupMostFewest
Platform checks155,64815,680
visionOS21,7604,528
watchOS16,416804
tvOS and CarPlay1,972208
Health and motion12,2721,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.

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.