import UIKit // Device-naming copy — "removed from this iPhone" — must follow the run target // rather than hard-code one. This iOS binary runs on three surfaces: iPhone, // iPad, and (via "Designed for iPad" on Apple Silicon) a Mac. `isiOSAppOnMac` // catches that last case, which otherwise reports the `.pad` idiom and would // mislabel a Mac as an iPad. (The genuinely-native macOS app is a separate // target with its own copy; this covers the iOS app running on a Mac.) enum DeviceName { static var current: String { if ProcessInfo.processInfo.isiOSAppOnMac { return "Mac" } return UIDevice.current.userInterfaceIdiom == .pad ? "iPad" : "iPhone" } }