{"id":"ea797c62-a2db-413c-8fc3-b4926f6c289f","shortId":"7dpzyx","kind":"skill","title":"ios-networking","tagline":"Build, review, or improve networking code in iOS/macOS apps using URLSession with async/await, structured concurrency, and modern Swift patterns. Use when working with REST APIs, downloading files, uploading data, WebSocket connections, pagination, retry logic, request middleware","description":"# iOS Networking\n\nModern networking patterns for iOS 26+ using URLSession with async/await and\nstructured concurrency. All examples target Swift 6.3. No third-party\ndependencies required -- URLSession covers the vast majority of networking\nneeds.\n\n## Contents\n\n- [Core URLSession async/await](#core-urlsession-asyncawait)\n- [API Client Architecture](#api-client-architecture)\n- [Error Handling](#error-handling)\n- [Pagination](#pagination)\n- [Network Reachability](#network-reachability)\n- [Configuring URLSession](#configuring-urlsession)\n- [App Transport Security (ATS)](#app-transport-security-ats)\n- [Common Mistakes](#common-mistakes)\n- [Review Checklist](#review-checklist)\n- [References](#references)\n\n## Core URLSession async/await\n\nURLSession gained native async/await overloads in iOS 15. These are the\nonly networking APIs to use in new code. Never use completion-handler\nvariants in new projects.\n\n### Data Requests\n\n```swift\n// Basic GET\nlet (data, response) = try await URLSession.shared.data(from: url)\n\n// With a configured URLRequest\nvar request = URLRequest(url: url)\nrequest.httpMethod = \"POST\"\nrequest.setValue(\"application/json\", forHTTPHeaderField: \"Content-Type\")\nrequest.httpBody = try JSONEncoder().encode(payload)\nrequest.timeoutInterval = 30\nrequest.cachePolicy = .reloadIgnoringLocalCacheData\n\nlet (data, response) = try await URLSession.shared.data(for: request)\n```\n\n### Response Validation\n\nAlways validate the HTTP status code before decoding. URLSession does not\nthrow for 4xx/5xx responses -- it only throws for transport-level failures.\n\n```swift\nguard let httpResponse = response as? HTTPURLResponse else {\n    throw NetworkError.invalidResponse\n}\n\nguard (200..<300).contains(httpResponse.statusCode) else {\n    throw NetworkError.httpError(\n        statusCode: httpResponse.statusCode,\n        data: data\n    )\n}\n```\n\n### JSON Decoding with Codable\n\n```swift\nfunc fetch<T: Decodable>(_ type: T.Type, from url: URL) async throws -> T {\n    let (data, response) = try await URLSession.shared.data(from: url)\n\n    guard let httpResponse = response as? HTTPURLResponse,\n          (200..<300).contains(httpResponse.statusCode) else {\n        throw NetworkError.invalidResponse\n    }\n\n    let decoder = JSONDecoder()\n    decoder.dateDecodingStrategy = .iso8601\n    decoder.keyDecodingStrategy = .convertFromSnakeCase\n    return try decoder.decode(T.self, from: data)\n}\n```\n\n### Downloads and Uploads\n\nUse `download(for:)` for large files -- it streams to disk instead of\nloading the entire payload into memory.\n\n```swift\n// Download to a temporary file\nlet (localURL, response) = try await URLSession.shared.download(for: request)\n\n// Move from temp location before the method returns\nlet destination = documentsDirectory.appendingPathComponent(\"file.zip\")\ntry FileManager.default.moveItem(at: localURL, to: destination)\n```\n\n```swift\n// Upload data\nlet (data, response) = try await URLSession.shared.upload(for: request, from: bodyData)\n\n// Upload from file\nlet (data, response) = try await URLSession.shared.upload(for: request, fromFile: fileURL)\n```\n\n### Streaming with AsyncBytes\n\nUse `bytes(for:)` for streaming responses, progress tracking, or\nline-delimited data (e.g., server-sent events).\n\n```swift\nlet (bytes, response) = try await URLSession.shared.bytes(for: request)\n\nfor try await line in bytes.lines {\n    // Process each line as it arrives (e.g., SSE stream)\n    handleEvent(line)\n}\n```\n\n## API Client Architecture\n\n### Protocol-Based Client\n\nDefine a protocol for testability. This lets you swap implementations in\ntests without mocking URLSession directly.\n\n```swift\nprotocol APIClientProtocol: Sendable {\n    func fetch<T: Decodable & Sendable>(\n        _ type: T.Type,\n        endpoint: Endpoint\n    ) async throws -> T\n\n    func send<T: Decodable & Sendable>(\n        _ type: T.Type,\n        endpoint: Endpoint,\n        body: some Encodable & Sendable\n    ) async throws -> T\n}\n```\n\n```swift\nstruct Endpoint: Sendable {\n    let path: String\n    var method: String = \"GET\"\n    var queryItems: [URLQueryItem] = []\n    var headers: [String: String] = [:]\n\n    func url(relativeTo baseURL: URL) -> URL {\n        guard let components = URLComponents(\n            url: baseURL.appendingPathComponent(path),\n            resolvingAgainstBaseURL: true\n        ) else {\n            preconditionFailure(\"Invalid URL components for path: \\(path)\")\n        }\n        var mutableComponents = components\n        if !queryItems.isEmpty {\n            mutableComponents.queryItems = queryItems\n        }\n        guard let url = mutableComponents.url else {\n            preconditionFailure(\"Failed to construct URL from components\")\n        }\n        return url\n    }\n}\n```\n\nThe client accepts a `baseURL`, optional custom `URLSession`, `JSONDecoder`,\nand an array of `RequestMiddleware` interceptors. Each method builds a\n`URLRequest` from the endpoint, applies middleware, executes the request,\nvalidates the status code, and decodes the result. See\n[references/urlsession-patterns.md](references/urlsession-patterns.md) for the complete `APIClient` implementation\nwith convenience methods, request builder, and test setup.\n\n### Lightweight Closure-Based Client\n\nFor apps using the MV pattern, use closure-based clients for testability\nand SwiftUI preview support. See [references/lightweight-clients.md](references/lightweight-clients.md) for\nthe full pattern (struct of async closures, injected via init).\n\n### Request Middleware / Interceptors\n\nMiddleware transforms requests before they are sent. Use this for\nauthentication, logging, analytics headers, and similar cross-cutting\nconcerns.\n\n```swift\nprotocol RequestMiddleware: Sendable {\n    func prepare(_ request: URLRequest) async throws -> URLRequest\n}\n```\n\n```swift\nstruct AuthMiddleware: RequestMiddleware {\n    let tokenProvider: @Sendable () async throws -> String\n\n    func prepare(_ request: URLRequest) async throws -> URLRequest {\n        var request = request\n        let token = try await tokenProvider()\n        request.setValue(\"Bearer \\(token)\", forHTTPHeaderField: \"Authorization\")\n        return request\n    }\n}\n```\n\n### Token Refresh Flow\n\nHandle 401 responses by refreshing the token and retrying once.\n\n```swift\nfunc fetchWithTokenRefresh<T: Decodable & Sendable>(\n    _ type: T.Type,\n    endpoint: Endpoint,\n    tokenStore: TokenStore\n) async throws -> T {\n    do {\n        return try await fetch(type, endpoint: endpoint)\n    } catch NetworkError.httpError(statusCode: 401, _) {\n        try await tokenStore.refreshToken()\n        return try await fetch(type, endpoint: endpoint)\n    }\n}\n```\n\n## Error Handling\n\n### Structured Error Types\n\n```swift\nenum NetworkError: Error, Sendable {\n    case invalidResponse\n    case httpError(statusCode: Int, data: Data)\n    case decodingFailed(Error)\n    case noConnection\n    case timedOut\n    case cancelled\n\n    /// Map a URLError to a typed NetworkError\n    static func from(_ urlError: URLError) -> NetworkError {\n        switch urlError.code {\n        case .notConnectedToInternet, .networkConnectionLost:\n            return .noConnection\n        case .timedOut:\n            return .timedOut\n        case .cancelled:\n            return .cancelled\n        default:\n            return .httpError(statusCode: -1, data: Data())\n        }\n    }\n}\n```\n\n### Key URLError Cases\n\n| URLError Code | Meaning | Action |\n|---|---|---|\n| `.notConnectedToInternet` | Device offline | Show offline UI, queue for retry |\n| `.networkConnectionLost` | Connection dropped mid-request | Retry with backoff |\n| `.timedOut` | Server did not respond in time | Retry once, then show error |\n| `.cancelled` | Task was cancelled | No action needed; do not show error |\n| `.cannotFindHost` | DNS failure | Check URL, show error |\n| `.secureConnectionFailed` | TLS handshake failed | Check cert pinning, ATS config |\n| `.userAuthenticationRequired` | 401 from proxy | Trigger auth flow |\n\n### Decoding Server Error Bodies\n\n```swift\nstruct APIErrorResponse: Decodable, Sendable {\n    let code: String\n    let message: String\n}\n\nfunc decodeAPIError(from data: Data) -> APIErrorResponse? {\n    try? JSONDecoder().decode(APIErrorResponse.self, from: data)\n}\n\n// Usage in catch block\ncatch NetworkError.httpError(let statusCode, let data) {\n    if let apiError = decodeAPIError(from: data) {\n        showError(\"Server error: \\(apiError.message)\")\n    } else {\n        showError(\"HTTP \\(statusCode)\")\n    }\n}\n```\n\n### Retry with Exponential Backoff\n\nUse structured concurrency for retries. Respect task cancellation between\nattempts. Skip retries for cancellation and 4xx client errors (except 429).\n\n```swift\nfunc withRetry<T: Sendable>(\n    maxAttempts: Int = 3,\n    initialDelay: Duration = .seconds(1),\n    operation: @Sendable () async throws -> T\n) async throws -> T {\n    var lastError: Error?\n    for attempt in 0..<maxAttempts {\n        do {\n            return try await operation()\n        } catch {\n            lastError = error\n            if error is CancellationError { throw error }\n            if case NetworkError.httpError(let code, _) = error,\n               (400..<500).contains(code), code != 429 { throw error }\n            if attempt < maxAttempts - 1 {\n                try await Task.sleep(for: initialDelay * Int(pow(2.0, Double(attempt))))\n            }\n        }\n    }\n    throw lastError!\n}\n```\n\n## Pagination\n\nBuild cursor-based or offset-based pagination with `AsyncSequence`.\nAlways check `Task.isCancelled` between pages. See\n[references/urlsession-patterns.md](references/urlsession-patterns.md) for complete `CursorPaginator` and\noffset-based implementations.\n\n## Network Reachability\n\nUse `NWPathMonitor` from the Network framework — not third-party\nReachability libraries. Wrap in `AsyncStream` for structured concurrency.\n\n```swift\nimport Network\n\nfunc networkStatusStream() -> AsyncStream<NWPath.Status> {\n    AsyncStream { continuation in\n        let monitor = NWPathMonitor()\n        monitor.pathUpdateHandler = { continuation.yield($0.status) }\n        continuation.onTermination = { _ in monitor.cancel() }\n        monitor.start(queue: DispatchQueue(label: \"NetworkMonitor\"))\n    }\n}\n```\n\nCheck `path.isExpensive` (cellular) and `path.isConstrained` (Low Data\nMode) to adapt behavior (reduce image quality, skip prefetching).\n\n## Configuring URLSession\n\nCreate a configured session for production code. `URLSession.shared` is\nacceptable only for simple, one-off requests.\n\n```swift\nlet configuration = URLSessionConfiguration.default\nconfiguration.timeoutIntervalForRequest = 30\nconfiguration.timeoutIntervalForResource = 300\nconfiguration.waitsForConnectivity = true\nconfiguration.requestCachePolicy = .returnCacheDataElseLoad\nconfiguration.httpAdditionalHeaders = [\n    \"Accept\": \"application/json\",\n    \"Accept-Language\": Locale.preferredLanguages.first ?? \"en\"\n]\n\nlet session = URLSession(configuration: configuration)\n```\n\n`waitsForConnectivity = true` is valuable -- it makes the session wait for\na network path instead of failing immediately when offline. Combine with\n`urlSession(_:taskIsWaitingForConnectivity:)` delegate callback for UI\nfeedback.\n\n## App Transport Security (ATS)\n\nATS enforces HTTPS for all connections by default. Do not disable it.\n\n### Requirements\n\n- TLS 1.2 or later\n- Forward secrecy cipher suites (ECDHE)\n- SHA-256 or better certificates\n- 2048-bit or greater RSA keys (or 256-bit ECC)\n\n### Exception Domains (Last Resort)\n\n```xml\n<key>NSAppTransportSecurity</key>\n<dict>\n    <key>NSExceptionDomains</key>\n    <dict>\n        <key>legacy-api.example.com</key>\n        <dict>\n            <key>NSExceptionAllowsInsecureHTTPLoads</key>\n            <true/>\n            <key>NSExceptionMinimumTLSVersion</key>\n            <string>TLSv1.2</string>\n        </dict>\n    </dict>\n</dict>\n```\n\n**Rules:**\n- Never set `NSAllowsArbitraryLoads` to `true` in production. App Review will reject it without justification.\n- Exception domains require justification in App Review notes.\n- Use exception domains only for third-party servers you cannot upgrade to HTTPS.\n- `NSAllowsLocalNetworking` is acceptable for local device communication (Bonjour, IoT).\n\n## Common Mistakes\n\n**DON'T:** Use `URLSession.shared` with custom configuration needs.\n**DO:** Create a configured `URLSession` with appropriate timeouts, caching,\nand delegate for production code.\n\n**DON'T:** Force-unwrap `URL(string:)` with dynamic input.\n**DO:** Use `URL(string:)` with proper error handling. Force-unwrap is\nacceptable only for compile-time-constant strings.\n\n**DON'T:** Decode JSON on the main thread for large payloads.\n**DO:** Keep decoding on the calling context of the URLSession call, which\nis off-main by default. Only hop to `@MainActor` to update UI state.\n\n**DON'T:** Ignore cancellation in long-running network tasks.\n**DO:** Check `Task.isCancelled` or call `try Task.checkCancellation()` in\nloops (pagination, streaming, retry). Use `.task` in SwiftUI for automatic\ncancellation.\n\n**DON'T:** Use Alamofire or Moya when URLSession async/await handles the\nneed.\n**DO:** Use URLSession directly. With async/await, the ergonomic gap that\njustified third-party libraries no longer exists. Reserve third-party\nlibraries for genuinely missing features (e.g., image caching).\n\n**DON'T:** Mock URLSession directly in tests.\n**DO:** Use `URLProtocol` subclass for transport-level mocking, or use\nprotocol-based clients that accept a test double.\n\n**DON'T:** Use `data(for:)` for large file downloads.\n**DO:** Use `download(for:)` which streams to disk and avoids memory spikes.\n\n**DON'T:** Fire network requests from `body` or view initializers.\n**DO:** Use `.task` or `.task(id:)` to trigger network calls.\n\n**DON'T:** Hardcode authentication tokens in requests.\n**DO:** Inject tokens via middleware so they are centralized and refreshable.\n\n**DON'T:** Ignore HTTP status codes and decode blindly.\n**DO:** Validate status codes before decoding. A 200 with invalid JSON and\na 500 with an error body require different handling.\n\n## Review Checklist\n\n- [ ] All network calls use async/await (not completion handlers)\n- [ ] Error handling covers URLError cases (.notConnectedToInternet, .timedOut, .cancelled)\n- [ ] Requests are cancellable (respect Task cancellation via `.task` modifier or stored Task references)\n- [ ] Authentication tokens injected via middleware, not hardcoded\n- [ ] Response HTTP status codes validated before decoding\n- [ ] Large downloads use `download(for:)` not `data(for:)`\n- [ ] Network calls happen off `@MainActor` (only UI updates on main)\n- [ ] URLSession configured with appropriate timeouts and caching\n- [ ] Retry logic excludes cancellation and 4xx client errors\n- [ ] Pagination checks `Task.isCancelled` between pages\n- [ ] Sensitive tokens stored in Keychain (not UserDefaults or plain files)\n- [ ] No force-unwrapped URLs from dynamic input\n- [ ] Server error responses decoded and surfaced to users\n- [ ] Ensure network response model types conform to Sendable; use @MainActor for UI-updating completion paths\n\n## References\n\n- See [references/urlsession-patterns.md](references/urlsession-patterns.md) for complete API client\n  implementation, multipart uploads, download progress, URLProtocol\n  mocking, retry/backoff, certificate pinning, request logging, and\n  pagination implementations.\n- See [references/background-websocket.md](references/background-websocket.md) for background URLSession\n  configuration, background downloads/uploads, WebSocket patterns with\n  structured concurrency, and reconnection strategies.\n- See [references/lightweight-clients.md](references/lightweight-clients.md) for the lightweight closure-based\n  client pattern (struct of async closures, injected via init for testability\n  and preview support).\n- See [references/network-framework.md](references/network-framework.md) for Network.framework (NWConnection,\n  NWListener, NWBrowser, NWPathMonitor) and low-level TCP/UDP/WebSocket patterns.\n- See [references/file-storage-patterns.md](references/file-storage-patterns.md) for file system directory\n  selection, FileProtectionType, backup exclusion, and storage pressure handling.","tags":["ios","networking","swift","skills","dpearson2699","accessibility","agent-skills","ai-coding","apple","claude-code","codex-skills","cursor-skills"],"capabilities":["skill","source-dpearson2699","skill-ios-networking","topic-accessibility","topic-agent-skills","topic-ai-coding","topic-apple","topic-claude-code","topic-codex-skills","topic-cursor-skills","topic-ios","topic-ios-development","topic-liquid-glass","topic-localization","topic-mapkit"],"categories":["swift-ios-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/dpearson2699/swift-ios-skills/ios-networking","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add dpearson2699/swift-ios-skills","source_repo":"https://github.com/dpearson2699/swift-ios-skills","install_from":"skills.sh"}},"qualityScore":"0.700","qualityRationale":"deterministic score 0.70 from registry signals: · indexed on github topic:agent-skills · 599 github stars · SKILL.md body (16,121 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T18:53:42.445Z","embedding":null,"createdAt":"2026-04-18T20:33:22.026Z","updatedAt":"2026-05-18T18:53:42.445Z","lastSeenAt":"2026-05-18T18:53:42.445Z","tsv":"'-1':798 '-256':1203 '0':971 '0.status':1079 '1':956,1004 '1.2':1194 '15':137 '2.0':1012 '200':241,281,1538 '2048':1207 '256':1214 '26':47 '3':952 '30':194,1128 '300':242,282,1130 '400':993 '401':696,728,866 '429':946,998 '4xx':942,1627 '4xx/5xx':220 '500':994,1544 '6.3':59 'accept':540,1115,1136,1139,1267,1320,1459 'accept-languag':1138 'action':807,843 'adapt':1097 'alamofir':1397 'alway':207,1029 'analyt':641 'api':28,82,86,143,427,1683 'api-client-architectur':85 'apicli':580 'apiclientprotocol':452 'apierror':911 'apierror.message':918 'apierrorrespons':878,892 'apierrorresponse.self':896 'app':12,106,111,596,1176,1236,1248 'app-transport-security-at':110 'appli':561 'application/json':183,1137 'appropri':1290,1618 'architectur':84,88,429 'array':549 'arriv':421 'async':264,460,473,621,657,667,674,714,959,962,1730 'async/await':16,51,77,129,133,1402,1411,1558 'asyncawait':81 'asyncbyt':382 'asyncsequ':1028 'asyncstream':1061,1070,1071 'at':109,114,863,1179,1180 'attempt':936,969,1002,1014 'auth':870 'authent':639,1507,1583 'authmiddlewar':662 'author':689 'automat':1392 'avoid':1481 'await':167,201,271,332,361,374,406,412,683,720,730,734,976,1006 'background':1704,1707 'backoff':825,926 'backup':1764 'base':432,593,604,1021,1025,1043,1456,1725 'baseurl':497,542 'baseurl.appendingpathcomponent':505 'basic':161 'bearer':686 'behavior':1098 'better':1205 'bit':1208,1215 'blind':1530 'block':902 'bodi':469,875,1490,1548 'bodydata':366 'bonjour':1272 'build':4,555,1018 'builder':586 'byte':384,403 'bytes.lines':415 'cach':1292,1435,1621 'call':1344,1349,1379,1503,1556,1606 'callback':1172 'cancel':765,791,793,838,841,934,940,1368,1393,1569,1572,1575,1625 'cancellationerror':984 'cannot':1261 'cannotfindhost':849 'case':749,751,757,760,762,764,781,786,790,803,988,1566 'catch':725,901,903,978 'cellular':1090 'central':1519 'cert':861 'certif':1206,1693 'check':852,860,1030,1088,1376,1631 'checklist':121,124,1553 'cipher':1199 'client':83,87,428,433,539,594,605,943,1457,1628,1684,1726 'closur':592,603,622,1724,1731 'closure-bas':591,602,1723 'codabl':255 'code':9,148,212,569,805,882,991,996,997,1112,1297,1527,1534,1593 'combin':1167 'common':115,118,1274 'common-mistak':117 'communic':1271 'compil':1324 'compile-time-const':1323 'complet':152,579,1038,1560,1675,1682 'completion-handl':151 'compon':502,513,519,535 'concern':648 'concurr':18,54,929,1064,1713 'config':864 'configur':101,104,173,1104,1108,1125,1146,1147,1282,1287,1616,1706 'configuration.httpadditionalheaders':1135 'configuration.requestcachepolicy':1133 'configuration.timeoutintervalforrequest':1127 'configuration.timeoutintervalforresource':1129 'configuration.waitsforconnectivity':1131 'configuring-urlsess':103 'conform':1666 'connect':34,818,1185 'constant':1326 'construct':532 'contain':243,283,995 'content':74,186 'content-typ':185 'context':1345 'continu':1072 'continuation.ontermination':1080 'continuation.yield':1078 'conveni':583 'convertfromsnakecas':294 'core':75,79,127 'core-urlsession-asyncawait':78 'cover':67,1564 'creat':1106,1285 'cross':646 'cross-cut':645 'cursor':1020 'cursor-bas':1019 'cursorpagin':1039 'custom':544,1281 'cut':647 'data':32,158,164,198,250,251,268,300,356,358,371,395,755,756,799,800,890,891,898,908,914,1094,1466,1603 'decod':214,253,289,571,872,879,895,1330,1341,1529,1536,1596,1656 'decodeapierror':888,912 'decoder.datedecodingstrategy':291 'decoder.decode':297 'decoder.keydecodingstrategy':293 'decodingfail':758 'default':794,1187,1356 'defin':434 'deleg':1171,1294 'delimit':394 'depend':64 'destin':345,353 'devic':809,1270 'differ':1550 'direct':449,1409,1440 'directori':1761 'disabl':1190 'disk':313,1479 'dispatchqueu':1085 'dns':850 'documentsdirectory.appendingpathcomponent':346 'domain':1218,1244,1253 'doubl':1013,1462 'download':29,301,305,323,1471,1474,1598,1600,1688 'downloads/uploads':1708 'drop':819 'durat':954 'dynam':1306,1651 'e.g':396,422,1433 'ecc':1216 'ecdh':1201 'els':237,245,285,509,528,919 'en':1142 'encod':191,471 'endpoint':458,459,467,468,478,560,710,711,723,724,737,738 'enforc':1181 'ensur':1661 'entir':318 'enum':745 'ergonom':1413 'error':89,92,739,742,747,759,837,848,855,874,917,944,967,980,982,986,992,1000,1314,1547,1562,1629,1654 'error-handl':91 'event':400 'exampl':56 'except':945,1217,1243,1252 'exclud':1624 'exclus':1765 'execut':563 'exist':1423 'exponenti':925 'fail':530,859,1163 'failur':229,851 'featur':1432 'feedback':1175 'fetch':258,455,721,735 'fetchwithtokenrefresh':707 'file':30,309,327,369,1470,1644,1759 'file.zip':347 'filemanager.default.moveitem':349 'fileprotectiontyp':1763 'fileurl':379 'fire':1486 'flow':694,871 'forc':1301,1317,1647 'force-unwrap':1300,1316,1646 'forhttpheaderfield':184,688 'forward':1197 'framework':1052 'fromfil':378 'full':617 'func':257,454,463,494,653,670,706,774,887,948,1068 'gain':131 'gap':1414 'genuin':1430 'get':162,486 'greater':1210 'guard':231,240,275,500,524 'handl':90,93,695,740,1315,1403,1551,1563,1769 'handleev':425 'handler':153,1561 'handshak':858 'happen':1607 'hardcod':1506,1589 'header':491,642 'hop':1358 'http':210,921,1525,1591 'httperror':752,796 'httprespons':233,277 'httpresponse.statuscode':244,249,284 'https':1182,1264 'httpurlrespons':236,280 'id':1499 'ignor':1367,1524 'imag':1100,1434 'immedi':1164 'implement':443,581,1044,1685,1699 'import':1066 'improv':7 'init':625,1734 'initi':1493 'initialdelay':953,1009 'inject':623,1512,1585,1732 'input':1307,1652 'instead':314,1161 'int':754,951,1010 'interceptor':552,628 'invalid':511,1540 'invalidrespons':750 'io':2,40,46,136 'ios-network':1 'ios/macos':11 'iot':1273 'iso8601':292 'json':252,1331,1541 'jsondecod':290,546,894 'jsonencod':190 'justif':1242,1246 'justifi':1416 'keep':1340 'key':801,1212 'keychain':1639 'label':1086 'languag':1140 'larg':308,1337,1469,1597 'last':1219 'lasterror':966,979,1016 'later':1196 'legacy-api.example.com':1224 'let':163,197,232,267,276,288,328,344,357,370,402,440,480,501,525,664,680,881,884,905,907,910,990,1074,1124,1143 'level':228,1450,1752 'librari':1058,1420,1428 'lightweight':590,1722 'line':393,413,418,426 'line-delimit':392 'load':316 'local':1269 'locale.preferredlanguages.first':1141 'localurl':329,351 'locat':339 'log':640,1696 'logic':37,1623 'long':1371 'long-run':1370 'longer':1422 'loop':1383 'low':1093,1751 'low-level':1750 'main':1334,1354,1614 'mainactor':1360,1609,1670 'major':70 'make':1153 'map':766 'maxattempt':950,972,1003 'mean':806 'memori':321,1482 'messag':885 'method':342,484,554,584 'mid':821 'mid-request':820 'middlewar':39,562,627,629,1515,1587 'miss':1431 'mistak':116,119,1275 'mock':447,1438,1451,1691 'mode':1095 'model':1664 'modern':20,42 'modifi':1578 'monitor':1075 'monitor.cancel':1082 'monitor.pathupdatehandler':1077 'monitor.start':1083 'move':336 'moya':1399 'multipart':1686 'mutablecompon':518 'mutablecomponents.queryitems':522 'mutablecomponents.url':527 'mv':599 'nativ':132 'need':73,844,1283,1405 'network':3,8,41,43,72,96,99,142,1045,1051,1067,1159,1373,1487,1502,1555,1605,1662 'network-reach':98 'network.framework':1744 'networkconnectionlost':783,817 'networkerror':746,772,778 'networkerror.httperror':247,726,904,989 'networkerror.invalidresponse':239,287 'networkmonitor':1087 'networkstatusstream':1069 'never':149,1229 'new':147,156 'noconnect':761,785 'notconnectedtointernet':782,808,1567 'note':1250 'nsallowsarbitraryload':1231 'nsallowslocalnetwork':1265 'nsapptransportsecur':1222 'nsexceptionallowsinsecurehttpload':1225 'nsexceptiondomain':1223 'nsexceptionminimumtlsvers':1226 'nwbrowser':1747 'nwconnect':1745 'nwlisten':1746 'nwpathmonitor':1048,1076,1748 'off-main':1352 'offlin':810,812,1166 'offset':1024,1042 'offset-bas':1023,1041 'one':1120 'one-off':1119 'oper':957,977 'option':543 'overload':134 'page':1033,1634 'pagin':35,94,95,1017,1026,1384,1630,1698 'parti':63,1056,1258,1419,1427 'path':481,506,515,516,1160,1676 'path.isconstrained':1092 'path.isexpensive':1089 'pattern':22,44,600,618,1710,1727,1754 'payload':192,319,1338 'pin':862,1694 'plain':1643 'post':181 'pow':1011 'preconditionfailur':510,529 'prefetch':1103 'prepar':654,671 'pressur':1768 'preview':610,1738 'process':416 'product':1111,1235,1296 'progress':389,1689 'project':157 'proper':1313 'protocol':431,436,451,650,1455 'protocol-bas':430,1454 'proxi':868 'qualiti':1101 'queryitem':488,523 'queryitems.isempty':521 'queue':814,1084 'reachabl':97,100,1046,1057 'reconnect':1715 'reduc':1099 'refer':125,126,1582,1677 'references/background-websocket.md':1701,1702 'references/file-storage-patterns.md':1756,1757 'references/lightweight-clients.md':613,614,1718,1719 'references/network-framework.md':1741,1742 'references/urlsession-patterns.md':575,576,1035,1036,1679,1680 'refresh':693,699,1521 'reject':1239 'relativeto':496 'reloadignoringlocalcachedata':196 'request':38,159,176,204,335,364,377,409,565,585,626,631,655,672,678,679,691,822,1122,1488,1510,1570,1695 'request.cachepolicy':195 'request.httpbody':188 'request.httpmethod':180 'request.setvalue':182,685 'request.timeoutinterval':193 'requestmiddlewar':551,651,663 'requir':65,1192,1245,1549 'reserv':1424 'resolvingagainstbaseurl':507 'resort':1220 'respect':932,1573 'respond':830 'respons':165,199,205,221,234,269,278,330,359,372,388,404,697,1590,1655,1663 'rest':27 'result':573 'retri':36,703,816,823,833,923,931,938,1386,1622 'retry/backoff':1692 'return':295,343,536,690,718,732,784,788,792,795,974 'returncachedataelseload':1134 'review':5,120,123,1237,1249,1552 'review-checklist':122 'rsa':1211 'rule':1228 'run':1372 'second':955 'secreci':1198 'secur':108,113,1178 'secureconnectionfail':856 'see':574,612,1034,1678,1700,1717,1740,1755 'select':1762 'send':464 'sendabl':453,472,479,652,666,748,880,958,1668 'sensit':1635 'sent':399,635 'server':398,827,873,916,1259,1653 'server-s':397 'session':1109,1144,1155 'set':1230 'setup':589 'sha':1202 'show':811,836,847,854 'showerror':915,920 'similar':644 'simpl':1118 'skill' 'skill-ios-networking' 'skip':937,1102 'source-dpearson2699' 'spike':1483 'sse':423 'state':1364 'static':773 'status':211,568,1526,1533,1592 'statuscod':248,727,753,797,906,922 'storag':1767 'store':1580,1637 'strategi':1716 'stream':311,380,387,424,1385,1477 'string':482,485,492,493,669,883,886,1304,1311,1327 'struct':477,619,661,877,1728 'structur':17,53,741,928,1063,1712 'subclass':1446 'suit':1200 'support':611,1739 'surfac':1658 'swap':442 'swift':21,58,160,230,256,322,354,401,450,476,649,660,705,744,876,947,1065,1123 'swiftui':609,1390 'switch':779 'system':1760 't.self':298 't.type':260,457,466,709 'target':57 'task':839,933,1374,1388,1496,1498,1574,1577,1581 'task.checkcancellation':1381 'task.iscancelled':1031,1377,1632 'task.sleep':1007 'taskiswaitingforconnect':1170 'tcp/udp/websocket':1753 'temp':338 'temporari':326 'test':445,588,1442,1461 'testabl':438,607,1736 'third':62,1055,1257,1418,1426 'third-parti':61,1054,1256,1417,1425 'thread':1335 'throw':218,224,238,246,265,286,461,474,658,668,675,715,960,963,985,999,1015 'time':832,1325 'timedout':763,787,789,826,1568 'timeout':1291,1619 'tls':857,1193 'tlsv1.2':1227 'token':681,687,692,701,1508,1513,1584,1636 'tokenprovid':665,684 'tokenstor':712,713 'tokenstore.refreshtoken':731 'topic-accessibility' 'topic-agent-skills' 'topic-ai-coding' 'topic-apple' 'topic-claude-code' 'topic-codex-skills' 'topic-cursor-skills' 'topic-ios' 'topic-ios-development' 'topic-liquid-glass' 'topic-localization' 'topic-mapkit' 'track':390 'transform':630 'transport':107,112,227,1177,1449 'transport-level':226,1448 'tri':166,189,200,270,296,331,348,360,373,405,411,682,719,729,733,893,975,1005,1380 'trigger':869,1501 'true':508,1132,1149,1233 'type':187,259,456,465,708,722,736,743,771,1665 'ui':813,1174,1363,1611,1673 'ui-upd':1672 'unwrap':1302,1318,1648 'updat':1362,1612,1674 'upgrad':1262 'upload':31,303,355,367,1687 'url':170,178,179,262,263,274,495,498,499,504,512,526,533,537,853,1303,1310,1649 'urlcompon':503 'urlerror':768,776,777,802,804,1565 'urlerror.code':780 'urlprotocol':1445,1690 'urlqueryitem':489 'urlrequest':174,177,557,656,659,673,676 'urlsess':14,49,66,76,80,102,105,128,130,215,448,545,1105,1145,1169,1288,1348,1401,1408,1439,1615,1705 'urlsession.shared':1113,1279 'urlsession.shared.bytes':407 'urlsession.shared.data':168,202,272 'urlsession.shared.download':333 'urlsession.shared.upload':362,375 'urlsessionconfiguration.default':1126 'usag':899 'use':13,23,48,145,150,304,383,597,601,636,927,1047,1251,1278,1309,1387,1396,1407,1444,1453,1465,1473,1495,1557,1599,1669 'user':1660 'userauthenticationrequir':865 'userdefault':1641 'valid':206,208,566,1532,1594 'valuabl':1151 'var':175,483,487,490,517,677,965 'variant':154 'vast':69 'via':624,1514,1576,1586,1733 'view':1492 'wait':1156 'waitsforconnect':1148 'websocket':33,1709 'without':446,1241 'withretri':949 'work':25 'wrap':1059 'xml':1221","prices":[{"id":"3dbd97d9-deb3-469e-8c52-9bb8a64c8896","listingId":"ea797c62-a2db-413c-8fc3-b4926f6c289f","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"dpearson2699","category":"swift-ios-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T20:33:22.026Z"}],"sources":[{"listingId":"ea797c62-a2db-413c-8fc3-b4926f6c289f","source":"github","sourceId":"dpearson2699/swift-ios-skills/ios-networking","sourceUrl":"https://github.com/dpearson2699/swift-ios-skills/tree/main/skills/ios-networking","isPrimary":false,"firstSeenAt":"2026-04-18T22:01:03.785Z","lastSeenAt":"2026-05-18T18:53:42.445Z"},{"listingId":"ea797c62-a2db-413c-8fc3-b4926f6c289f","source":"skills_sh","sourceId":"dpearson2699/swift-ios-skills/ios-networking","sourceUrl":"https://skills.sh/dpearson2699/swift-ios-skills/ios-networking","isPrimary":true,"firstSeenAt":"2026-04-18T20:33:22.026Z","lastSeenAt":"2026-05-07T22:40:31.781Z"}],"details":{"listingId":"ea797c62-a2db-413c-8fc3-b4926f6c289f","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"dpearson2699","slug":"ios-networking","github":{"repo":"dpearson2699/swift-ios-skills","stars":599,"topics":["accessibility","agent-skills","ai-coding","apple","claude-code","codex-skills","cursor-skills","ios","ios-development","liquid-glass","localization","mapkit","networking","storekit","swift","swift-concurrency","swiftdata","swiftui","widgetkit","xcode"],"license":"other","html_url":"https://github.com/dpearson2699/swift-ios-skills","pushed_at":"2026-04-26T21:04:17Z","description":"Agent Skills for iOS 26+, Swift 6.3, SwiftUI, and modern Apple frameworks","skill_md_sha":"824c6604196246f48cd325372491c51d2f52b506","skill_md_path":"skills/ios-networking/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/dpearson2699/swift-ios-skills/tree/main/skills/ios-networking"},"layout":"multi","source":"github","category":"swift-ios-skills","frontmatter":{"name":"ios-networking","description":"Build, review, or improve networking code in iOS/macOS apps using URLSession with async/await, structured concurrency, and modern Swift patterns. Use when working with REST APIs, downloading files, uploading data, WebSocket connections, pagination, retry logic, request middleware, caching, background transfers, or network reachability monitoring. Also use when handling HTTP requests, API clients, network error handling, or data fetching in Swift apps."},"skills_sh_url":"https://skills.sh/dpearson2699/swift-ios-skills/ios-networking"},"updatedAt":"2026-05-18T18:53:42.445Z"}}