Device

Code

UIDevice.current.userInterfaceIdiom == .pad
UIDevice.current.userInterfaceIdiom == .phone
UIDevice.current.userInterfaceIdiom == .unspecified

References

SO | detect-current-device-with-ui-user-interface-idiom-in-swift

apple dev | uikit/uidevices