Skip to content
GuidesChecked 20 November 2026

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.

Swift files, all 13 words
WordFiles
Codable1,392,640
JSONDecoder()531,456
JSONSerialization358,789
Decodable285,184
dataTask(with97,792
import Network59,776
shared.data(for41,216
shared.data(from26,176
NWPathMonitor11,264
WebSocketTask10,528
dataTaskPublisher8,256
SCNetworkReachability3,424
Config.background2,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.

Swift files by URLSession word
URLSession wordFiles
dataTask(with97,792
shared.data(for41,216
shared.data(from26,176
WebSocketTask10,528
dataTaskPublisher8,256
Config.background2,596

Per 100 dataTask

URLSession.shared.data(from is in 26.8 files for every 100 with dataTask(with.

URLSession.shared.data(for is in 42.1 files for every 100 with dataTask(with.

The base is the 97,792 files with dataTask(with.

Swift files per 100 with dataTask(with
WordPer 100
shared.data(for42.1
shared.data(from26.8

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.

Swift files by decoding word
Decoding wordFiles
Codable1,392,640
JSONDecoder()531,456
JSONSerialization358,789
Decodable285,184

Per 100 Codable

JSONSerialization is in 25.8 files per 100 and Decodable in 20.5.

JSONDecoder() is in 38.2 files for every 100 with Codable.

The base is the 1,392,640 files with Codable, the most common of the 13 words.

Swift files per 100 with Codable
WordPer 100
JSONDecoder()38.2
JSONSerialization25.8
Decodable20.5

Connection checks

import Network is in 59,776 files, 5.3 times NWPathMonitor.

NWPathMonitor is in 3.3 times the files of SCNetworkReachability.

Swift files by connection word
Connection wordFiles
import Network59,776
NWPathMonitor11,264
SCNetworkReachability3,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.

Times one word is in more files than the other
Word over wordTimes
Codable over dataTask(with14.2
URLSession.shared.data(for over URLSessionConfiguration.background15.9
JSONDecoder() over dataTask(with5.4
import Network over NWPathMonitor5.3
JSONDecoder() over JSONSerialization1.5
NWPathMonitor over SCNetworkReachability3.3
URLSessionWebSocketTask over dataTaskPublisher1.3
URLSession.shared.data(for over URLSession.shared.data(from1.6
Codable over Decodable4.9

By group

The URLSession words spread 37.7 to 1, and the decoding words only 4.9 to 1.

Swift files, the most and the fewest of each group
GroupMostFewest
URLSession97,7922,596
Decoding1,392,640285,184
Connection checks59,7763,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.

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.