SwiftSDK icon indicating copy to clipboard operation
SwiftSDK copied to clipboard

macCatalyst version numbers are wrong

Open michaellenaghan opened this issue 1 year ago • 3 comments

SwiftClient is reporting the wrong macCatalyst version numbers here, here and here. Take a look a this screenshot from the dashboard:

Screenshot 2023-05-19 at 1 50 25 PM

macCatalyst runs on macOS, and they each have their own version numbers. macCatalyst version numbers should correspond to iOS versions, though, not macOS versions as they do above. See, for example, the availability info for Widget in Apple's docs:

Screenshot 2023-05-19 at 2 11 34 PM

Notice how the iOS and macCatalyst versions match, and how the macOS version is lower.

So what the screenshot shows as macCatalyst 13.3 is most likely, in fact, macCatalyst 16.4 (running on macOS 13.3).

The reason this matters is that in development we often have to use #available. Someone making a decision based on TelemetryDeck's reporting could accidentally use the wrong version number.

I nearly did that today!

I already had system reporting code in my own app. Here's what it looks like:

    private func deviceSummary() -> String {
        if processInfo.isiOSAppOnMac {
            if processInfo.isMacCatalystApp {
                return
                    "iOS on Mac (\(uiDevice.systemName) \(uiDevice.systemVersion) running on macOS \(processInfo.operatingSystemVersionMajor).\(processInfo.operatingSystemVersionMinor).\(processInfo.operatingSystemVersionPatch))"
            }
        }
        if processInfo.isMacCatalystApp {
            return
                "Mac (\(uiDevice.systemName) \(uiDevice.systemVersion) running on macOS \(processInfo.operatingSystemVersionMajor).\(processInfo.operatingSystemVersionMinor).\(processInfo.operatingSystemVersionPatch))"
        }
        return "\(uiDevice.model) (\(uiDevice.systemName) \(uiDevice.systemVersion))"
    }

And this is what it produces on my Mac:

Screenshot 2023-05-19 at 2 06 49 PM

michaellenaghan avatar May 19 '23 18:05 michaellenaghan