iPad running iPhone app returns true to isiPhone
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
FWIW I think this should not be as intended. An iPad running in iPhone mode can't have a connected Watch session (which is how I found this) and probably has other differences too.
I'm happy to raise a PR either to change the documentation or remove the logic about the userInterfaceIdiom, but it would be good to get feedback from the project owners on if there is any philosophy on this.
You are right. The UIDevice.current.userInterfaceIdiom == .phone check should be removed.
If you could open a PR that would be really great!
Hi there, can I work on this issue?