Builds or reviews Apple-platform networking with URLSession, async/await, and structured concurrency. Use for REST clients, uploads/downloads, WebSockets, pagination, retries, middleware, caching, background transfers, reachability, request errors, or network data loading.
89%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Build and review Apple-platform networking using URLSession with native async/await, structured concurrency, and Network.framework. Targets Swift 6.4 / iOS 26+.
URLSession.shared.data(for:), download(for:), and bytes(for:) for all foreground network operations.URLSession only throws for transport-level failures (offline, DNS, timeout). It does not throw on 4xx or 5xx responses. Always validate (200..<300).contains(httpResponse.statusCode).let (data, response) = try await session.data(for: request)
guard let httpResponse = response as? HTTPURLResponse else {
throw NetworkError.invalidResponse
}
guard (200..<300).contains(httpResponse.statusCode) else {
throw NetworkError.httpError(statusCode: httpResponse.statusCode, data: data)
}Differentiate error categories: transport errors (URLError), decoding errors (DecodingError), client errors (4xx), server errors (5xx), and cancellation (CancellationError).
| Transfer Mode | API Pattern | Session Configuration | Suspension Behavior |
|---|---|---|---|
| Foreground Data | try await session.data(for:) | .default or .ephemeral | Cancelled on app suspension |
| Foreground Download | try await session.download(for:) | .default | Pauses/cancels on suspension |
| Background Transfer | session.downloadTask(with:) with delegate | URLSessionConfiguration.background(withIdentifier:) | Managed out-of-process; relaunches app on finish |
| WebSocket | session.webSocketTask(with:) | .default | Reconnection required on resume |
NWPathMonitor, read Network Framework.URLSession.data(for:) throws on HTTP 404 or 500 responses instead of inspecting statusCode.URLSessionConfiguration, which requires delegate callbacks.NWPathMonitor instances or starting monitoring without setting a dispatch queue.urlSession(_:downloadTask:didFinishDownloadingTo:) (file is deleted upon return).thienqo/ios-skills
6bf8b62
Canonical home
since May 23, 2026
Also appears in
on Oct 29, 2026
since May 22, 2026
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.