Axiom networking

From ComeOnOliver/skillshub · View interactive version

Axiom networking is an AI agent skill from the GitHub repository ComeOnOliver/skillshub. Use when implementing Network.framework connections, debugging connection failures, migrating from sockets/URLSession streams, or adopting structured concurrency networking patterns - prevents deprecated API usage, reachability anti-patterns, and thread-safety violations with iOS 12-26+ APIs

How to use this skill

Skill file

Network.framework Networking

When to Use This Skill

Use when:

Related Skills

Example Prompts

1. "How do I migrate from SCNetworkReachability? My app checks connectivity before connecting."
2. "My connection times out after 60 seconds. How do I debug this?"
3. "Should I use NWConnection or NetworkConnection? What's the difference?"

Red Flags — Anti-Patterns to Prevent

If you're doing ANY of these, STOP and use the patterns in this skill:

❌ CRITICAL — Never Do These

1. Using SCNetworkReachability to check connectivity before connecting
// ❌ WRONG — Race condition
if SCNetworkReachabilityGetFlags(reachability, &flags) {
    connection.start() // Network may change between check and start
}

Why this fails Network state changes between reachability check and connect(). You miss Network.framework's smart connection establishment (Happy Eyeballs, proxy handling, WiFi Assist). Apple deprecated this API in 2018.

2. Blocking socket operations on main thread
// ❌ WRONG — Guaranteed ANR (Application Not Responding)
let socket = socket(AF_INET, SOCK_STREAM, 0)
connect(socket, &addr, addrlen) // Blocks main thread

Why this fails Main thread hang → frozen UI → App Store rejection for responsiveness. Even "quick" connects take 200-500ms.

3. Manual DNS resolution with getaddrinfo
// ❌ WRONG — Misses Happy Eyeballs, proxies, VPN
var hints = addrinfo(...)
getaddrinfo("example.com", "443", &hints, &results)
// Now manually try each address...

Why this fails You reimplement 10+ years of Apple's connection logic poorly. Misses IPv4/IPv6 racing, proxy evaluation, VPN detection.

4. Hardcoded IP addresses instead of hostnames
// ❌ WRONG — Breaks proxy/VPN compatibility
let host = "192.168.1.1" // or any IP literal

Why this fails Proxy auto-configuration (PAC) needs hostname to evaluate rules. VPNs can't route properly. DNS-based load balancing broken.

5. Ignoring waiting state — not handling lack of connectivity
// ❌ WRONG — Poor UX
connection.stateUpdateHandler = { state in
    if case .ready = state {
        // Handle ready
    }
    // Missing: .waiting case
}

Why this fails User sees "Connection failed" in Airplane Mode instead of "Waiting for network." No automatic retry when WiFi returns.

6. Not using [weak self] in NWConnection completion handlers
// ❌ WRONG — Memory leak
connection.send(content: data, completion: .contentProcessed { error in
    self.handleSend(error) // Retain cycle: connection → handler → self → connection
})

Why this fails Connection retains completion handler, handler captures self strongly, self retains connection → memory leak.

7. Mixing async/await and completion handlers in NetworkConnection (iOS 26+)
// ❌ WRONG — Structured concurrency violation
Task {
    let connection = NetworkConnection(...)
    connection.send(data) // async/await
    connection.stateUpdateHandler = { ... } // completion handler — don't mix
}

Why this fails NetworkConnection designed for pure async/await. Mixing paradigms creates difficult error propagation and cancellation issues.

8. Not supporting network transitions
// ❌ WRONG — Connection fails on WiFi → cellular transition
// No viabilityUpdateHandler, no betterPathUpdateHandler
// User walks out of building → connection dies

Why this fails Modern apps must handle network changes gracefully. 40% of connection failures happen during network transitions.


Mandatory First Steps

ALWAYS complete these steps before writing any networking code:

// Step 1: Identify your use case
// Record: "UDP gaming" vs "TLS messaging" vs "Custom protocol over QUIC"
// Ask: What data am I sending? Real-time? Reliable delivery needed?

// Step 2: Check if URLSession is sufficient
// URLSession handles: HTTP, HTTPS, WebSocket, TCP/TLS streams (via StreamTask)
// Network.framework handles: UDP, custom protocols, low-level control, peer-to-peer

// If HTTP/HTTPS/WebSocket → STOP, use URLSession instead
// Example:
URLSession.shared.dataTask(with: url) { ... } // ✅ Correct for HTTP

// Step 3: Choose API version based on deployment target
if #available(iOS 26, *) {
    // Use NetworkConnection (structured concurrency, async/await)
    // TLV framing built-in, Coder protocol for Codable types
} else {
    // Use NWConnection (completion handlers)
    // Manual framing or custom framers
}

// Step 4: Verify you're NOT using deprecated APIs
// Search your codebase for these:
// - SCNetworkReachability → Use connection waiting state
// - CFSocket → Use NWConnection
// - NSStream, CFStream → Use NWConnection
// - NSNetService → Use NWBrowser or NetworkBrowser
// - getaddrinfo → Let Network.framework handle DNS

// To search:
// grep -rn "SCNetworkReachability\|CFSocket\|NSStream\|getaddrinfo" .
What this tells you

Decision Tree

Use this to select the correct pattern in 2 minutes:

Need networking?
├─ HTTP, HTTPS, or WebSocket?
│  └─ YES → Use URLSession (NOT Network.framework)
│     ✅ URLSession.shared.dataTask(with: url)
│     ✅ URLSession.webSocketTask(with: url)
│     ✅ URLSession.streamTask(withHostName:port:) for TCP/TLS
│
├─ iOS 26+ and can use structured concurrency?
│  └─ YES → NetworkConnection path (async/await)
│     ├─ TCP with TLS security?
│     │  └─ Pattern 1a: NetworkConnection + TLS
│     │     Time: 10-15 minutes
│     │
│     ├─ UDP for gaming/streaming?
│     │  └─ Pattern 1b: NetworkConnection + UDP
│     │     Time: 10-15 minutes
│     │
│     ├─ Need message boundaries (framing)?
│     │  └─ Pattern 1c: TLV Framing
│     │     Type-Length-Value for mixed message types
│     │     Time: 15-20 minutes
│     │
│     └─ Send/receive Codable objects directly?
│        └─ Pattern 1d: Coder Protocol
│           No manual JSON encoding needed
│           Time: 10-15 minutes
│
└─ iOS 12-25 or need completion handlers?
   └─ YES → NWConnection path (callbacks)
      ├─ TCP with TLS security?
      │  └─ Pattern 2a: NWConnection + TLS
      │     stateUpdateHandler, completion-based send/receive
      │     Time: 15-20 minutes
      │
      ├─ UDP streaming with batching?
      │  └─ Pattern 2b: NWConnection + UDP Batch
      │     connection.batch for 30% CPU reduction
      │     Time: 10-15 minutes
      │
      ├─ Listening for incoming connections?
      │  └─ Pattern 2c: NWListener
      │     Accept inbound connections, newConnectionHandler
      │     Time: 20-25 minutes
      │
      └─ Network discovery (Bonjour)?
         └─ Pattern 2d: NWBrowser
            Discover services on local network
            Time: 25-30 minutes
Quick selection guide

Common Patterns

Pattern 1a: NetworkConnection with TLS (iOS 26+)

Use when iOS 26+ deployment, need reliable TCP with TLS security, want async/await

Time cost 10-15 minutes

❌ BAD: Manual DNS, Blocking Socket
// WRONG — Don't do this
var hints = addrinfo(...)
getaddrinfo("www.example.com", "1029", &hints, &results)
let sock = socket(AF_INET, SOCK_STREAM, 0)
connect(sock, results.pointee.ai_addr, results.pointee.ai_addrlen) // Blocks!
✅ GOOD: NetworkConnection with Declarative Stack
import Network

// Basic connection with TLS
let connection = NetworkConnection(
    to: .hostPort(host: "www.example.com", port: 1029)
) {
    TLS() // TCP and IP inferred automatically
}

// Send and receive with async/await
public func sendAndReceiveWithTLS() async throws {
    let outgoingData = Data("Hello, world!".utf8)
    try await connection.send(outgoingData)

    let incomingData = try await connection.receive(exactly: 98).content
    print("Received data: \(incomingData)")
}

// Optional: Monitor connection state for UI updates
Task {
    for await state in connection.states {
        switch state {
        case .preparing:
            print("Establishing connection...")
        case .ready:
            print("Connected!")
        case .waiting(let error):
            print("Waiting for network: \(error)")
        case .failed(let error):
            print("Connection failed: \(error)")
        case .cancelled:
            print("Connection cancelled")
        @unknown default:
            break
        }
    }
}
Custom parameters for low data mode
let connection = NetworkConnection(
    to: .hostPort(host: "www.example.com", port: 1029),
    using: .parameters {
        TLS {
            TCP {
                IP()
                    .fragmentationEnabled(false)
            }
        }
    }
    .constrainedPathsProhibited(true) // Don't use cellular in low data mode
)
When to use
Performance characteristics
Debugging

Pattern 1b: NetworkConnection UDP (iOS 26+)

Use when iOS 26+ deployment, need UDP datagrams for gaming or real-time streaming, want async/await

Time cost 10-15 minutes

❌ BAD: Blocking UDP Socket
// WRONG — Don't do this
let sock = socket(AF_INET, SOCK_DGRAM, 0)
let sent = sendto(sock, buffer, length, 0, &addr, addrlen)
// Blocks, no batching, axiom-high CPU overhead
✅ GOOD: NetworkConnection with UDP
import Network

// UDP connection for real-time data
let connection = NetworkConnection(
    to: .hostPort(host: "game-server.example.com", port: 9000)
) {
    UDP()
}

// Send game state update
public func sendGameUpdate() async throws {
    let gameState = Data("player_position:100,50".utf8)
    try await connection.send(gameState)
}

// Receive game updates
public func receiveGameUpdates() async throws {
    while true {
        let (data, _) = try await connection.receive()
        processGameState(data)
    }
}

// Batch multiple datagrams for efficiency (30% CPU reduction)
public func sendMultipleUpdates(_ updates: [Data]) async throws {
    for update in updates {
        try await connection.send(update)
    }
}
When to use
Performance characteristics
Debugging

Pattern 1c: TLV Framing (iOS 26+)

Use when Need message boundaries on stream protocols (TCP/TLS), have mixed message types, want type-safe message handling

Time cost 15-20 minutes

Background Stream protocols (TCP/TLS) don't preserve message boundaries. If you send 3 chunks, receiver might get them 1 byte at a time, or all at once. TLV (Type-Length-Value) solves this by encoding each message with its type and length.

❌ BAD: Manual Length Prefix Parsing
// WRONG — Error-prone, boilerplate-heavy
let lengthData = try await connection.receive(exactly: 4).content
let length = lengthData.withUnsafeBytes { $0.load(as: UInt32.self) }
let messageData = try await connection.receive(exactly: Int(length)).content
// Now decode manually...
✅ GOOD: TLV Framing with Type Safety
import Network

// Define your message types
enum GameMessage: Int {
    case selectedCharacter = 0
    case move = 1
}

struct GameCharacter: Codable {
    let character: String
}

struct GameMove: Codable {
    let row: Int
    let column: Int
}

// Connection with TLV framing
let connection = NetworkConnection(
    to: .hostPort(host: "www.example.com", port: 1029)
) {
    TLV {
        TLS()
    }
}

// Send typed messages
public func sendWithTLV() async throws {
    let characterData = try JSONEncoder().encode(GameCharacter(character: "🐨"))
    try await connection.send(characterData, type: GameMessage.selectedCharacter.rawValue)
}

// Receive typed messages
public func receiveWithTLV() async throws {
    let (incomingData, metadata) = try await connection.receive()

    switch GameMessage(rawValue: metadata.type) {
    case .selectedCharacter:
        let character = try JSONDecoder().decode(GameCharacter.self, from: incomingData)
        print("Character selected: \(character)")
    case .move:
        let move = try JSONDecoder().decode(GameMove.self, from: incomingData)
        print("Move: row=\(move.row), column=\(move.column)")
    case .none:
        print("Unknown message type: \(metadata.type)")
    }
}
When to use
How it works
Performance characteristics

Pattern 1d: Coder Protocol (iOS 26+)

Use when Sending/receiving Codable types, want to eliminate JSON boilerplate, need type-safe message handling

Time cost 10-15 minutes

Background Most apps manually encode Codable types to JSON, send bytes, receive bytes, decode JSON. Coder protocol eliminates this boilerplate by handling serialization automatically.

❌ BAD: Manual JSON Encoding/Decoding
// WRONG — Boilerplate-heavy, error-prone
let encoder = JSONEncoder()
let data = try encoder.encode(message)
try await connection.send(data)

let receivedData = try await connection.receive().content
let decoder = JSONDecoder()
let message = try decoder.decode(GameMessage.self, from: receivedData)
✅ GOOD: Coder Protocol for Direct Codable Send/Receive
import Network

// Define message types as Codable enum
enum GameMessage: Codable {
    case selectedCharacter(String)
    case move(row: Int, column: Int)
}

// Connection with Coder protocol
let connection = NetworkConnection(
    to: .hostPort(host: "www.example.com", port: 1029)
) {
    Coder(GameMessage.self, using: .json) {
        TLS()
    }
}

// Send Codable types directly
public func sendWithCoder() async throws {
    let selectedCharacter: GameMessage = .selectedCharacter("🐨")
    try await connection.send(selectedCharacter) // No encoding needed!
}

// Receive Codable types directly
public func receiveWithCoder() async throws {
    let gameMessage = try await connection.receive().content // Returns GameMessage!

    switch gameMessage {
    case .selectedCharacter(let character):
        print("Character selected: \(character)")
    case .move(let row, let column):
        print("Move: (\(row), \(column))")
    }
}
Supported formats
When to use
When NOT to use
Benefits

Legacy iOS 12-25 Patterns

For apps supporting iOS 12-25 that can't use async/await yet, invoke /skill axiom-networking-legacy:

Pressure Scenarios

Scenario 1: Reachability Race Condition Under App Store Deadline

Context

You're 3 days from App Store submission. QA reports connection failures on cellular networks (15% failure rate). Your PM reviews the code and suggests: "Just add a reachability check before connecting. If there's no network, show an error immediately instead of timing out."

Pressure signals
Rationalization trap

"SCNetworkReachability is Apple's API, it must be correct. I've seen it in Stack Overflow answers with 500+ upvotes. Adding a quick reachability check will fix the issue today, and I can refactor it properly after launch. The deadline is more important than perfect code right now."

Why this fails
  1. Race condition Network state changes between reachability check and connection start. You check "WiFi available" at 10:00:00.000, but WiFi disconnects at 10:00:00.050, then you call connection.start() at 10:00:00.100. Connection fails, but reachability said it was available.
  1. Misses smart connection establishment Network.framework tries multiple strategies (IPv4, IPv6, proxies, WiFi Assist fallback to cellular). SCNetworkReachability gives you "yes/no" but doesn't tell you which strategy will work.
  1. Deprecated API Apple explicitly deprecated SCNetworkReachability in WWDC 2018. App Store Review may flag this as using legacy APIs.
  1. Doesn't solve actual problem 15% cellular failures likely caused by not handling waiting state, not by absence of reachability check.
MANDATORY response
// ❌ NEVER check reachability before connecting
/*
if SCNetworkReachabilityGetFlags(reachability, &flags) {
    if flags.contains(.reachable) {
        connection.start()
    } else {
        showError("No network") // RACE CONDITION
    }
}
*/

// ✅ ALWAYS let Network.framework handle waiting state
let connection = NWConnection(
    host: NWEndpoint.Host("api.example.com"),
    port: NWEndpoint.Port(integerLiteral: 443),
    using: .tls
)

connection.stateUpdateHandler = { [weak self] state in
    switch state {
    case .preparing:
        // Show: "Connecting..."
        self?.showStatus("Connecting...")

    case .ready:
        // Connection established
        self?.hideStatus()
        self?.sendRequest()

    case .waiting(let error):
        // CRITICAL: Don't fail here, show "Waiting for network"
        // Network.framework will automatically retry when network returns
        print("Waiting for network: \(error)")
        self?.showStatus("Waiting for network...")
        // User walks out of elevator → WiFi returns → automatic retry

    case .failed(let error):
        // Only fail after framework exhausts all options
        // (tried IPv4, IPv6, proxies, WiFi Assist, waited for network)
        print("Connection failed: \(error)")
        self?.showError("Connection failed. Please check your network.")

    case .cancelled:
        self?.hideStatus()

    @unknown default:
        break
    }
}

connection.start(queue: .main)
Professional push-back template

"I understand the deadline pressure. However, adding SCNetworkReachability will create a race condition that will make the 15% failure rate worse, not better. Apple deprecated this API in 2018 specifically because it causes these issues.

The correct fix is to handle the waiting state properly, which Network.framework provides. This will actually solve the cellular failures because the framework will automatically retry when network becomes available (e.g., user walks out of elevator, WiFi returns).

Implementation time: 15 minutes to add waiting state handler vs 2-4 hours debugging reachability race conditions. The waiting state approach is both faster AND more reliable."

Time saved
Actual root cause of 15% cellular failures

Likely missing waiting state handler. When user is in area with weak cellular, connection moves to waiting state. Without handler, app shows "Connection failed" instead of "Waiting for network," so user force-quits and reports "doesn't work on cellular."


Scenario 2: Blocking Socket Call Causing Main Thread Hang

Context

Your app has 1-star reviews: "App freezes for 5-10 seconds randomly." After investigation, you find a "quick" socket connect() call on the main thread. Your tech lead says: "This is a legacy code path from 2015. It only connects to localhost (127.0.0.1), so it should be instant. The real fix is a 3-week refactor to move all networking to a background queue, but we don't have time. Just leave it for now."

Pressure signals
Rationalization trap

"Connecting to localhost is basically instant. The freeze must be caused by something else. Besides, refactoring this legacy code is risky—what if I break something? Better to leave working code alone and focus on the new features for 2.0."

Why this fails
  1. Even localhost can block If the app has many threads, the kernel may schedule other work before returning from connect(). Even 50-100ms is visible to users as a stutter.
  1. ANR (Application Not Responding) iOS watchdog will terminate your app if main thread blocks for >5 seconds. This explains "random" crashes.
  1. Localhost isn't always available If VPN is active, localhost routing can be delayed. If device is under memory pressure, kernel scheduling is slower.
  1. Guaranteed App Store rejection Apple's App Store Review Guidelines explicitly check for main thread blocking. This will fail App Review's performance tests.
MANDATORY response
// ❌ NEVER call blocking socket APIs on main thread
/*
let sock = socket(AF_INET, SOCK_STREAM, 0)
connect(sock, &addr, addrlen) // BLOCKS MAIN THREAD → ANR
*/

// ✅ ALWAYS use async connection, even for localhost
func connectToLocalhost() {
    let connection = NWConnection(
        host: "127.0.0.1",
        port: 8080,
        using: .tcp
    )

    connection.stateUpdateHandler = { [weak self] state in
        switch state {
        case .ready:
            print("Connected to localhost")
            self?.sendRequest(on: connection)
        case .failed(let error):
            print("Localhost connection failed: \(error)")
        default:
            break
        }
    }

    // Non-blocking, returns immediately
    connection.start(queue: .main)
}
Alternative: If you must keep legacy socket code (not recommended)
// Move blocking call to background queue (minimum viable fix)
DispatchQueue.global(qos: .userInitiated).async {
    let sock = socket(AF_INET, SOCK_STREAM, 0)
    connect(sock, &addr, addrlen) // Still blocks, but not main thread

    DispatchQueue.main.async {
        // Update UI after connection
    }
}
Professional push-back template

"I understand this code has been stable for 8 years. However, Apple's App Store Review now runs automated performance tests that will fail apps with main thread blocking. This will block our 2.0 release.

The fix doesn't require a 3-week refactor. I can wrap the existing socket code in a background queue dispatch in 30 minutes. Or, I can replace it with NWConnection (non-blocking) in 45 minutes, which also eliminates the socket management code entirely.

Neither approach requires touching other parts of the codebase. We can ship 2.0 on schedule AND fix the ANR crashes."

Time saved

Scenario 3: Design Review Pressure — "Use WebSockets for Everything"

Context

Your team is building a multiplayer game with real-time player positions (20 updates/second). In architecture review, the senior architect says: "All our other apps use WebSockets for networking. We should use WebSockets here too for consistency. It's production-proven, and the backend team already knows how to deploy WebSocket servers."

Pressure signals
Rationalization trap

"The architect has way more experience than me. If WebSockets work for the other apps, they'll work here too. UDP sounds complicated and risky. Better to stick with proven technology than introduce something new that might break in production."

Why this fails for real-time gaming
  1. Head-of-line blocking WebSockets use TCP. If one packet is lost, TCP blocks ALL subsequent packets until retransmission succeeds. In a game, this means old player position (frame 100) blocks new position (frame 120), causing stutter.
  1. Latency overhead TCP requires 3-way handshake (SYN, SYN-ACK, ACK) before sending data. For 20 updates/second, this overhead adds 50-150ms latency.
  1. Unnecessary reliability Game position updates don't need guaranteed delivery. If frame 100 is lost, frame 101 (5ms later) makes it obsolete. TCP retransmits frame 100, wasting bandwidth.
  1. Connection establishment WebSockets require HTTP upgrade handshake (4 round trips) before data transfer. UDP starts sending immediately.
MANDATORY response
// ❌ WRONG for real-time gaming
/*
let webSocket = URLSession.shared.webSocketTask(with: url)
webSocket.resume()
webSocket.send(.data(positionUpdate)) { error in
    // TCP guarantees delivery but blocks on loss
    // Old position blocks new position → stutter
}
*/

// ✅ CORRECT for real-time gaming
let connection = NWConnection(
    host: NWEndpoint.Host("game-server.example.com"),
    port: NWEndpoint.Port(integerLiteral: 9000),
    using: .udp
)

connection.stateUpdateHandler = { state in
    if case .ready = state {
        print("Ready to send game updates")
    }
}

connection.start(queue: .main)

// Send player position updates (20/second)
func sendPosition(_ position: PlayerPosition) {
    let data = encodePosition(position)
    connection.send(content: data, completion: .contentProcessed { error in
        // Fire and forget, no blocking
        // If this frame is lost, next frame (50ms later) makes it obsolete
    })
}
Technical comparison table

| Aspect | WebSocket (TCP) | UDP |

|--------|----------------|-----|

| Latency (typical) | 50-150ms | 10-30ms |

| Head-of-line blocking | Yes (old data blocks new) | No |

| Connection setup | 4 round trips (HTTP upgrade) | 0 round trips |

| Packet loss handling | Blocks until retransmit | Continues with next packet |

| Bandwidth (20 updates/sec) | ~40 KB/s | ~20 KB/s |

| Best for | Chat, API calls | Gaming, streaming |

Professional push-back template

"I appreciate the concern about consistency and proven technology. WebSockets are excellent for our other apps because they're doing chat, notifications, and API calls—use cases where guaranteed delivery matters.

However, real-time gaming has different requirements. Let me explain with a concrete example:

Player moves from position A to B to C (3 updates in 150ms). With WebSockets:

- Frame A sent

- Frame A packet lost

- Frame B sent, but TCP blocks it (waiting for Frame A retransmit)

- Frame C sent, also blocked

- Frame A retransmits, arrives 200ms later

- Frames B and C finally delivered

- Result: 200ms of frozen player position, then sudden jump to C

With UDP:

- Frame A sent and lost

- Frame B sent and delivered (50ms later)

- Frame C sent and delivered (50ms later)

- Result: Smooth position updates, no freeze

The backend team doesn't need to learn UDP from scratch—they can use the same Network.framework on server-side Swift (Vapor, Hummingbird). Implementation time is the same.

I'm happy to do a proof-of-concept this week showing latency comparison. We can measure both approaches with real data."

When WebSockets ARE correct
Time saved

Migration Guides

For detailed migration guides from legacy networking APIs, invoke /skill axiom-networking-migration:

Checklist

Before shipping networking code, verify:

Deprecated API Check

Connection Configuration

Memory Management

Network Transitions

Testing on Real Devices

Performance

Error Handling

iOS 26+ Features (if using NetworkConnection)


Real-World Impact

User-Space Networking: 30% CPU Reduction

WWDC 2018 Demo Live UDP video streaming comparison:

Why Traditional sockets copy data kernel → userspace. Network.framework uses memory-mapped regions (no copy) and reduces context switches from 100 syscalls → ~1 syscall (with batching).

Impact for your app

Smart Connection Establishment: 50% Faster

Traditional approach
  1. Call getaddrinfo (100-300ms DNS lookup)
  2. Try first IPv6 address, wait 5 seconds for timeout
  3. Try IPv4 address, finally connects
Network.framework (Happy Eyeballs)
  1. Start DNS lookup in background
  2. As soon as first address arrives, try connecting
  3. Start second connection attempt 50ms later
  4. Use whichever connects first

Result 50% faster connection establishment in dual-stack environments (measured by Apple)

Proper State Handling: 10x Crash Reduction

Customer report App crash rate dropped from 5% → 0.5% after implementing waiting state handler.

Before App showed "Connection failed" when no network, users force-quit app → crash report.

After App showed "Waiting for network" and automatically retried when WiFi returned → users saw seamless reconnection.


Resources

WWDC: 2018-715, 2025-250

Skills: axiom-networking-diag, axiom-network-framework-ref


Last Updated 2025-12-02

Status Production-ready patterns from WWDC 2018 and WWDC 2025

Tested Patterns validated against Apple documentation and WWDC transcripts

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.