SwiftSDK
SwiftSDK copied to clipboard
macCatalyst version numbers are wrong
SwiftClient
is reporting the wrong macCatalyst
version numbers here, here and here. Take a look a this screenshot from the dashboard:
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:
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: