URLSession, Codable and Network in Swift
13 URLSession, decoding and connection check 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.
All 13 words
Codable is in 1,392,640 Swift files, 536 times the 2,596 of URLSessionConfiguration.background.
| Word | Files |
|---|---|
| Codable | 1,392,640 |
| JSONDecoder() | 531,456 |
| JSONSerialization | 358,789 |
| Decodable | 285,184 |
| dataTask(with | 97,792 |
| import Network | 59,776 |
| shared.data(for | 41,216 |
| shared.data(from | 26,176 |
| NWPathMonitor | 11,264 |
| WebSocketTask | 10,528 |
| dataTaskPublisher | 8,256 |
| SCNetworkReachability | 3,424 |
| Config.background | 2,596 |
URLSession
dataTask(with is in 97,792 files, 2.4 times URLSession.shared.data(for.
URLSession.shared.data(for is in 1.6 times the files of URLSession.shared.data(from.
| URLSession word | Files |
|---|---|
| dataTask(with | 97,792 |
| shared.data(for | 41,216 |
| shared.data(from | 26,176 |
| WebSocketTask | 10,528 |
| dataTaskPublisher | 8,256 |
| Config.background | 2,596 |
Sockets and background
URLSessionWebSocketTask is in 10,528 files, dataTaskPublisher in 8,256 and URLSessionConfiguration.background in 2,596.
dataTask(with is in 9.3 times the files of URLSessionWebSocketTask.
dataTask(with is in 11.8 times the files of dataTaskPublisher, the Combine way to load a URL.
URLSessionWebSocketTask is in 1.3 times the files of dataTaskPublisher.
URLSessionWebSocketTask is in about one file for every nine with dataTask(with, so web socket code is a small part of the group.
dataTaskPublisher is in 3.2 times the files of URLSessionConfiguration.background, the setting for a download that goes on after the app closes.
The six URLSession words have the widest spread of the three groups, 37.7 to 1.
Decoding
Codable is in 1,392,640 files, 2.6 times JSONDecoder() and 4.9 times Decodable.
JSONDecoder() is in 1.5 times the files of JSONSerialization.
| Decoding word | Files |
|---|---|
| Codable | 1,392,640 |
| JSONDecoder() | 531,456 |
| JSONSerialization | 358,789 |
| Decodable | 285,184 |
Connection checks
import Network is in 59,776 files, 5.3 times NWPathMonitor.
NWPathMonitor is in 3.3 times the files of SCNetworkReachability.
| Connection word | Files |
|---|---|
| import Network | 59,776 |
| NWPathMonitor | 11,264 |
| SCNetworkReachability | 3,424 |
Nine pairs
Nine pairs set one word against another, and the ratios run from 1.3 to 15.9.
Codable is in 14.2 times the files of dataTask(with.
URLSession.shared.data(for is in 15.9 times the files of URLSessionConfiguration.background.
| Word over word | Times |
|---|---|
| Codable over dataTask(with | 14.2 |
| URLSession.shared.data(for over URLSessionConfiguration.background | 15.9 |
| JSONDecoder() over dataTask(with | 5.4 |
| import Network over NWPathMonitor | 5.3 |
| JSONDecoder() over JSONSerialization | 1.5 |
| NWPathMonitor over SCNetworkReachability | 3.3 |
| URLSessionWebSocketTask over dataTaskPublisher | 1.3 |
| URLSession.shared.data(for over URLSession.shared.data(from | 1.6 |
| Codable over Decodable | 4.9 |
By group
The URLSession words spread 37.7 to 1, and the decoding words only 4.9 to 1.
| Group | Most | Fewest |
|---|---|---|
| URLSession | 97,792 | 2,596 |
| Decoding | 1,392,640 | 285,184 |
| Connection checks | 59,776 | 3,424 |
What is in the file
A count for each word
6 URLSession words, 4 decoding words, and 3 connection check words.
Words set against a base
Async calls per 100 dataTask(with files, and decoding words per 100 Codable files.
Ratios you can quote
import Network is in 17.5 times the files of SCNetworkReachability.
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 13 searches
Each search names one Apple type, call or import, matched as exact text in Swift files.
Ask the code search
Make one request per search, pausing at least seven seconds between requests.
Repeat incomplete results
When the service flagged a result incomplete, the request was repeated, up to three times.
Keep the count
Store the word, its group, its count and its search as a CSV row, never code.
How a board client should call and decode
Decoding is settled. Codable is in 1,392,640 files and JSONDecoder() in 531,456, ahead of JSONSerialization at 358,789, so a board client that decodes its responses into Codable types matches the habit.
The call itself varies, with dataTask(with in 97,792 files, the async data(for in 41,216 and data(from in 26,176. NWPathMonitor is in 11,264, so checking the connection before a vote is a minority habit, and a vote that is queued and sent later removes the need.
What these numbers leave out
- These are files and not apps or users, and not how many requests an app makes.
- Large counts are rounded, so a gap under about 10 percent means level.
- Only Apple words are counted here, so networking code that uses other libraries is missed.
- A search matches text, so a method of the same name on another type is counted too.
- A word can sit in a comment or a string, so a count does not show that code calls it.
- Copied samples count every time, most forks are left out, and no code was read.
Swift networking code questions
How many Swift files use Codable?
It is in 1,392,640 public files, the most of the 13 words.
How many files create a JSONDecoder?
JSONDecoder() is in 531,456 files, 38.2 for every 100 with Codable.
How many files use JSONSerialization?
It is in 358,789 files, and JSONDecoder() is in 1.5 times as many.
How many files use dataTask(with?
It is in 97,792 files, the most of the URLSession words.
How many files use the async URLSession calls?
URLSession.shared.data(for is in 41,216 files and URLSession.shared.data(from in 26,176.
How many files use web sockets?
URLSessionWebSocketTask is in 10,528 files.
How many files use Combine to load a URL?
dataTaskPublisher is in 8,256 files.
How many files set up a background session?
URLSessionConfiguration.background is in 2,596 files, the fewest of the 13.
How many files watch the connection?
NWPathMonitor is in 11,264 files and SCNetworkReachability in 3,424.
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. Give the page name and 1 November 2026, the count date, with any figure you quote.
More Swift code, counted
More counts for Swift developers.
SwiftUI and Swift API words counted in public Swift files
56 APIs, from NavigationStack to @Observable.
How much Swift code uses concurrency, GCD and Combine?
24 Swift concurrency words in Swift files.
SwiftUI vs UIKit and 22 more Apple frameworks, counted
24 Apple frameworks counted in public Swift files.
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.