What problem does it solve?
This Skill provides a comprehensive guide to Apple's Network.framework, clarifying its evolution from NWConnection (iOS 12-25) to NetworkConnection (iOS 26+). It helps developers navigate API differences, implement modern networking patterns, and migrate from older APIs without issues.
Core Features & Use Cases
- Comprehensive API Reference: Detailed guide covering
NetworkConnection (async/await), NWConnection (completion handlers), TLV framing, Coder protocol, and Wi-Fi Aware discovery.
- Migration Strategies: Clear pathways for transitioning from BSD sockets,
CFSocket, NSStream, or NWConnection to modern NetworkConnection.
- Performance & Security Optimization: Best practices for user-space networking, UDP batching, TLS configuration, certificate pinning, and mobility handling.
- Use Case: When planning to migrate an existing app's networking stack from
NWConnection to the new NetworkConnection with async/await, use this skill to understand the API differences and best practices for a smooth transition.
Quick Start
To create a basic TLS connection with NetworkConnection (iOS 26+), use NetworkConnection(to: .hostPort(host: "www.example.com", port: 1029)) { TLS() }.