-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
identify app running under macOS 13 Catalyst #214
Comments
You can do that in the following way: #if targetEnvironment(macCatalyst)
let catalyst = true
#else
let catalyst = false
#endif Or do you rather want a function like so? Device.current.isMacCatalyst |
Hi @Zandor300 Thanks for this awesome project! As per above
|
so
return
maybe a |
Identification of Mac models would be ideal but I’m not sure what’s the apple API for that. |
I make a PR for mac runtime and models #217 With some change I test it with mac catalyst inside an iOS app So |
@phimage I think we don't need a In case the code is in a framework that supports both iOS/Catalyst and native macOS, that can be checked using the following code I've posted here before: #if targetEnvironment(macCatalyst)
let catalyst = true
#else
let catalyst = false
#endif |
Yes but we could also identify a device without using First I thinks it is crappy to return If we want to display the device name or we want to have a generic #if os(iOS)
switch Device.current.realDevice {
case .iPhone11Pro:
...
case .macCatalyst:
...
}
#endif
and yes I use `#if targetEnvironment(macCatalyst)` in my current test code for mac catalyst and DeviceKit to get mac model identifier instead of current "x86_64" |
Self-explanatory
The text was updated successfully, but these errors were encountered: