To detect if the user is using an iPad or iPhone or something else in Swift do something like this:
switch UIDevice.current.userInterfaceIdiom { case .phone: deviceLavel.text = "iPhone" case .pad: deviceLavel.text = "iPad" case .unspecified: deviceLavel.text = "unspecified" case .tv: deviceLavel.text = "tv" case .carPlay: deviceLavel.text = "carPlay" }