BWSnippet

Swift - iOS get users device type

Swift - iOS get users device type

Get the users device type using swift.

        switch UIDevice.currentDevice().userInterfaceIdiom {
        case .TV:
            print(" TV")
            break
        case .Pad:
            print(" Pad")
            break
        case .Phone:
            print(" Phone")
            break
        case .Unspecified:
            print(" Unspecified")
            break
        default:
            print(" Unknown ")
        }

Tags

Swift - iOS get users device type