Skip to content

Commit 832eb80

Browse files
authored
Merge pull request #4 from dustturtle/copilot/add-reasoning-for-ios-13
docs: explain why iOS 13+ is required instead of iOS 12
2 parents f40505e + bcf7eaf commit 832eb80

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,26 @@ Available in **two versions**:
2323
- Swift 5.9+ (for Swift version)
2424
- Xcode 15+ (for Objective-C version)
2525

26+
### Why iOS 13+ instead of iOS 12?
27+
28+
Although `Network.framework` was introduced in iOS 12 (WWDC 2018), this library requires **iOS 13+** for the following reasons:
29+
30+
| Aspect | iOS 12 | iOS 13+ |
31+
|--------|--------|---------|
32+
| Network.framework availability | ✅ Available | ✅ Available |
33+
| Stability & bug fixes | ❌ Known issues with `NWConnection` callbacks and memory leaks | ✅ Major fixes shipped |
34+
| Continuous read loop reliability | ⚠️ Edge-case bugs in `NWConnection.receive()` under high-frequency reads | ✅ Stable |
35+
| Swift runtime | ❌ Must be embedded in app bundle | ✅ Built into the OS |
36+
37+
**Key details:**
38+
39+
1. **Network.framework maturity** — Apple significantly improved `NWConnection` reliability in iOS 13, fixing known issues with callback delivery and memory management that existed in the iOS 12 initial release.
40+
2. **Continuous read loop stability** — This library's core architecture uses a high-frequency continuous read loop (`receive()` → buffer → dequeue → `receive()`). This pattern triggers edge-case bugs on iOS 12 that were resolved in iOS 13.
41+
3. **Swift runtime built-in** — Starting from iOS 13, the Swift runtime is bundled with the OS, which reduces app binary size and avoids runtime compatibility issues.
42+
4. **Platform version alignment** — iOS 13 / macOS 10.15 / tvOS 13 / watchOS 6 are all from the same 2019 release cycle, ensuring a consistent and well-tested foundation across all Apple platforms.
43+
44+
> **Note:** If you absolutely need iOS 12 support, changing `.iOS(.v13)` to `.iOS(.v12)` in `Package.swift` will compile, but thorough testing on iOS 12 devices is strongly recommended — especially for long-lived connections and high-frequency read/write scenarios.
45+
2646
## Installation
2747

2848
### Swift Package Manager

0 commit comments

Comments
 (0)