What problem does it solve?
Modernizes and hardens networking code for iOS and macOS apps by replacing fragile completion-handler patterns and ad-hoc implementations with URLSession async/await, structured concurrency, consistent error handling, and production-ready background and streaming support.
Core Features & Use Cases
- URLSession async/await: Use data(for:), download(for:), upload(for:), and bytes(for:) for streaming and efficient memory usage.
- API client architecture: Protocol-based clients, Endpoint/request builders, middleware for authentication/logging, and testable closure-based lightweight clients.
- Error handling & retries: Typed NetworkError mapping, HTTP status validation, exponential backoff with jitter, and cancellation awareness.
- Pagination & large transfers: Cursor and offset paginators using AsyncSequence, download-to-disk for large files, and background session delegate patterns.
- WebSocket & Network.framework: Structured concurrency patterns for URLSessionWebSocketTask and guidance for NWPathMonitor/NWConnection when low-level control is required.
- Testing & Security: URLProtocol transport mocking, certificate pinning guidance, and configuration recommendations for production URLSession instances.
Quick Start
Ask the ios-networking skill to review and refactor an API client's URLSession-based fetch method to use async/await, validate HTTP status codes, and add retry/backoff and token-middleware.