diff --git a/swift/TailscaleKit/IncomingConnection.swift b/swift/TailscaleKit/IncomingConnection.swift index a67766a..9e16aa0 100644 --- a/swift/TailscaleKit/IncomingConnection.swift +++ b/swift/TailscaleKit/IncomingConnection.swift @@ -7,6 +7,12 @@ import Foundation /// IncomingConnection is use to read incoming message from an inbound /// connection. IncomingConnections are not instantiated directly, /// they are returned by Listener.accept +// Gated so the rest of TailscaleKit can be built for older systems. +// `state()` returns `any AsyncSequence`, whose `Failure` +// associated type is iOS 18 / macOS 15 only, and that requirement propagates to +// the whole framework even for clients that never listen for inbound +// connections. Annotating the two listener types confines it to them. +@available(iOS 18.0, macOS 15.0, tvOS 18.0, watchOS 11.0, *) public actor IncomingConnection { private let logger: LogSink? private var conn: TailscaleConnection = 0 diff --git a/swift/TailscaleKit/Listener.swift b/swift/TailscaleKit/Listener.swift index 67d89e3..2a59454 100644 --- a/swift/TailscaleKit/Listener.swift +++ b/swift/TailscaleKit/Listener.swift @@ -6,6 +6,12 @@ import Foundation /// A Listener is used to await incoming connections from another /// Tailnet node. +// Gated so the rest of TailscaleKit can be built for older systems. +// `state()` returns `any AsyncSequence`, whose `Failure` +// associated type is iOS 18 / macOS 15 only, and that requirement propagates to +// the whole framework even for clients that never listen for inbound +// connections. Annotating the two listener types confines it to them. +@available(iOS 18.0, macOS 15.0, tvOS 18.0, watchOS 11.0, *) public actor Listener { private var tailscale: TailscaleHandle private var listener: TailscaleListener = 0