emqx / CocoaMQTT

MQTT 5.0 client library for iOS and macOS written in Swift
https://www.emqx.com/en
Other
1.58k stars 413 forks source link

Compile error on iOS16 in CocoaMQTTTypes.swift #478

Closed philippzagar closed 1 year ago

philippzagar commented 1 year ago

When compiling this library on iOS16, I get the following compile error in the CocoaMQTTTypes.swift file:

image

Is this a known issue?

leeway1208 commented 1 year ago

Hi. How about these. You can replace the code and have a try.

public enum CocoaMQTTError: Error {
    case invalidURL
    case readTimeout
    case writeTimeout
    if #available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
        public enum FoundationConnection : Error {
            case closed(URLSessionWebSocketTask.CloseCode)
        }
    }
}