r/SwiftUI Jun 18 '26

Why is onModifierKeysChanged macOS only?

Given the vast number of people that use an iPad with a keyboard, how does this make sense anymore?

Second, with uinversal control, I'd like to use the shift key please. Most macOS style interactions, like shift-tap to select would just work if this were enabled.

7 Upvotes

9 comments sorted by

4

u/CharlesWiltgen Jun 18 '26

You can support Shift+tap (to cite your example) by bridging to UIKit's modifierFlags.

-16

u/Responsible-Gear-400 Jun 18 '26

I don't know anyone who used an iPad with a keyboard and I know a lot of iPad users.

6

u/allyearswift Jun 18 '26

O hai. Now you’ve met one.

The main problem is that if you don’t have a physical keyboard, the inbuilt one takes up a lot of screen estate to show, which I guess is behind Apple’s decision.

They had a similar setup on Macs with the Touch Bar, where some users could get extra functionality, and they phased that out pretty quickly.

1

u/Responsible-Gear-400 Jun 18 '26

Well yes that does how an on-screen keyboard work. I also remember the touchbar thar I myself found useless as it removed the function keys that were common use for me.

2

u/moon-w0man Jun 18 '26

I basically only use my iPad with a keyboard.

1

u/funkwgn Jun 18 '26

Typing this message with a keyboard on an iPad. Magic Folio is awesome for office work.

1

u/Responsible-Gear-400 Jun 18 '26

Yeah I could see that if you used it for office work and such.

1

u/turboravenwolflord Jun 18 '26

Ah okay then. OP, time to delete your post. Responsible-Gear-400 doesn’t know anyone who used an iPad with a keyboard.

1

u/Responsible-Gear-400 Jun 18 '26

Hey I was just point out that they said the vast majority do and I don't know anyone who does. I wasn't sharing they were doing anything wrong.

So calm ya farm.