ios-networking

Build type-safe iOS networking with URLSession and Swift Concurrency.

6|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/koshkinvv/ios-agent-skills --skill ios-networking-koshkinvv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ios-networking
Source: https://github.com/koshkinvv/ios-agent-skills/tree/main/skills/ios-networking
Command: npx skills add https://github.com/koshkinvv/ios-agent-skills --skill ios-networking-koshkinvv

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

iOS developers often struggle to build robust, scalable networking layers that handle authentication, retries, caching, and multiple data formats. This Skill provides a production-ready blueprint for a type-safe URLSession-based API client with a reusable Endpoint protocol and an Actor-based TokenManager.

Core Features & Use Cases

  • Type-safe APIClient built around an Endpoint protocol for clean, scalable requests
  • Async/await networking with URLSession, generic responses, and Codable decoding
  • Actor-based TokenManager for safe OAuth2 token refresh and deduplication
  • Built-in error handling with retry/backoff for 5xx and rate limits, plus support for REST and GraphQL (Apollo)
  • Caching strategies and testing guidance (URLProtocol-based tests, offline patterns)

Quick Start

Clone the repository and begin integrating the APIClient with your endpoints to implement a robust, async networking layer.

Frequently Asked Questions about ios-networking

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a type-safe API client using URLSession and Swift Concurrency?

Build a type-safe API client using URLSession and Swift Concurrency by defining an Endpoint protocol and a generic APIClient for async/await execution with Codable decoding. This provides scalable, compile-time validated network interactions.

How do I handle OAuth2 token refresh and deduplication in Swift?

Handle OAuth2 token refresh and deduplication in Swift using an Actor-based TokenManager. This mechanism safely manages concurrent token refresh requests, preventing duplicate network calls and race conditions during authentication flows.

What's the best way to implement exponential backoff retry for URLSession requests?

Implement exponential backoff retry for URLSession requests within a generic APIClient to automatically recover from 5xx server errors and rate limits. This approach ensures robust network interactions without manual retry loops.

Does this networking approach support both REST and GraphQL with Apollo on iOS 13+?

Yes, this networking approach supports REST and GraphQL with Apollo on iOS 13+ environments. The APIClient architecture integrates both protocols alongside strong error handling and observability for scalable data fetching.

How do I test URLSession networking with URLProtocol for offline caching patterns?

Test URLSession networking with URLProtocol to mock network responses and verify offline caching strategies. This testing guidance ensures your APIClient handles intermittent connectivity and offline patterns reliably.