Closed honkmaster closed 2 years ago
Any thoughts on when this might work with Xcode 13?
The solution (at least for us) was quite simple. Increase the swift-tools-version to 5.3 and iOS version to iOS 14 in Package.swift as well as removing the @available macro. However, as this limits the target platforms, I can understand that this is not a solution for everyone. That is also why I did not create a pull request.
Looks like it's the expected behavior https://bugs.swift.org/browse/SR-14878.
Any ETA on the fix or a workaround?
CocoaMQTTWebSocket.zip You can try to overwrite these two files (CocoaMQTTTypes.swift and CocoaMQTTWebSocket.swift)
@leeway1208 Thanks, I've done something similar on my end as a temporary workaround, which works for our use case. But I'll try to create a PR with a proper fix when I find time.
I created a pull request with a possible solution. Feedback highly welcome βΊοΈ
I don't know if this is something I'm doing wrong, but this package no longer builds in Xcode. I'm running Xcode 13.1 and the package does not compile (git tag : 2.0.0, commit : "57e87704505b01e9e7d355b1b5b952e255db4998". I get a compile error:
error: cannot find type 'NSObject' in scope
public class MqttAuthProperties: NSObject {
^~~~~~~~
The file MqttAuthProperties.swift begins:
//
// MqttAuthProperties.swift
// CocoaMQTT
//
// Created by liwei wang on 1/9/2021.
//
public class MqttAuthProperties: NSObject {
I found that importing Foundation before the public class definition fixed the error:
//
// MqttAuthProperties.swift
// CocoaMQTT
//
// Created by liwei wang on 1/9/2021.
//
import Foundation
public class MqttAuthProperties: NSObject {
@DerekK19 hi, I test the project and do not happen this problem π. But I will fix this to prevent it from happening again. thanks
Maybe it's Xcode 13.1, or maybe it's my computer - I tried a separate test class and got the same behaviour
class x : NSObject { }
gives an error if there is no import Foundation before
@DerekK19 Thanks ππ
The following code
within CocoaMQTTTypes.swift produces an error:
Enum cases with associated values cannot be marked potentially unavailable with '@available'
The error was reported to Apple via Feedback Assistant and Forum. However it is not fixed yet (Beta 3). It seems like it is here to stay...