Skip to content
Back to skills

Ios Networking

ASecurity

Standards for URLSession, Alamofire, and API communication. Use when implementing URLSession networking, Alamofire, or API clients in iOS. (triggers: **/*Service.swift, **/*API.swift, **/*Client.swift, URLSession, Alamofire, Moya, URLRequest, URLComponents, Codable)

  • 67 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 10, 2026
developmentrustswiftapisecurity

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 10, 2026

npx -y skills add ComeOnOliver/skillshub --skill ios-networking --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ios Networking?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ios Networking
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/comeonoliver-ios-networking/badge)](https://www.skillsdirectory.com/skills/comeonoliver-ios-networking)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ios-networking
description: 'Standards for URLSession, Alamofire, and API communication. Use when implementing URLSession networking, Alamofire, or API clients in iOS. (triggers: **/*Service.swift, **/*API.swift, **/*Client.swift, URLSession, Alamofire, Moya, URLRequest, URLComponents, Codable)'
---

# iOS Networking Standards

## **Priority: P0**

## Implementation Guidelines

### URLSession (Native)

- **Tasks**: Use `dataTaskPublisher` (Combine) or **async/await** (e.g., `let (data, response) = await URLSession.shared.data(...)`).
- **Configuration**: Use `URLSessionConfiguration.default` for standard tasks and `ephemeral` for private browsing/clearing cache.
- **Request Building**: Use **`URLComponents` and `URLQueryItem`** to build URLs safely with parameters. **Never use string interpolation** for URL parameters.

### Alamofire (Standard Third-Party)

- **Session**: Maintain a singleton or DI-injected `Session` instance.
- **Request**: Use **`.validate()`** to automatically check for **200..299** status codes.
- **Encoding**: Use `JSONParameterEncoder.default` for body parameters.
- **Retriers**: Handle a **401 token refresh** with a `RequestInterceptor`. Use `onRetry` to call the `refreshToken()` API.

### Best Practices

- **Codable**: Use **Codable** for all JSON decoding/mapping. Prefer `snake_case` strategies for API data consistency.
- **Bearer Token Auth**: Use **RequestInterceptor** to add the **Bearer header** (`Authorization: Bearer <token>`) to all API requests.
- **SSL Pinning**: Implement using **ServerTrustManager** or `TrustKit` for production-grade security.

## Anti-Patterns

- **No UI updates in background task**: Always dispatch to MainActor or main thread.
- **No manual JSONSerialization**: Use **Codable** and `JSONDecoder`.
- **No indefinite wait**: Set a reasonable timeoutInterval (30s default).

## References

- [Native & Alamofire Implementation](references/implementation.md)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.