镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

iPad running iPhone app returns true to isiPhone #447

Description

@lewis-smith

I'm not sure if this is a bug or intended, but thought I'd raise it for awareness.

I'm running on the 2026 beta 1, so this may resolve in time anyway.

/// Returns whether the device is an iPhone (real or simulator)
    public var isPhone: Bool {
      return (isOneOf(Device.allPhones)
              || isOneOf(Device.allSimulatorPhones)
              || (UIDevice.current.userInterfaceIdiom == .phone && isCurrent)) && !isPod
    }
(lldb) po Device.current
iPad Mini (A17 Pro)
(lldb) po Device.current.isPhone
true
(lldb) po isOneOf(Device.allPhones)
false
(lldb) po isOneOf(Device.allSimulatorPhones)
false
(lldb) po UIDevice.current.userInterfaceIdiom == .phone
true

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions