I know Swift is relatively new, but I was wondering if there was a way to determine the device type?
(Like you used to be able to do with a #define)?
#define
This should provide you with every use case:
#if os(OSX) print("macOS") #elseif os(watchOS) print("watchOS") #elseif os(tvOS) print("tvOS") #elseif os(iOS) #if targetEnvironment(macCatalyst) print("macOS - Catalyst") #else print("iOS") #endif #endif