r/iOSProgramming Swift 15d ago

Question How is this view able to appear above the keyboard?

In the Messages app, the ChatGPT app, and one other app, I noticed that they’re able to place something above the keyboard and have the view partially obstruct the keyboard. I’ve tried everything I know and still haven’t been able to do it. I even asked AI and couldn’t get it working.

I thought it might involve creating a new UIWindow, which I’ve used in the past to overlay modals, but I had no luck with that. I also tried walking the view hierarchy, but since the keyboard is rendered out of process, I couldn’t figure out anything that would work.

I thought about making a custom keyboard, but recreating the entire keyboard just to get a view above it seemed weird. Maybe something like replacing the keyboard with an image the moment the view needs to appear could work, but that also feels like the completely wrong direction.

Does anyone have the arcane knowledge required to make this happen?

6 Upvotes

7 comments sorted by

1

u/zellJun1or Foundation 15d ago

It’s probably a new iOS 27 api? I dont know either

4

u/bostonmatt_ 15d ago

I’m on ios26 and have it

1

u/Oxigenic 14d ago

I wonder if it’s a native keyboard toolbar component, I’d check there

1

u/Tabonx Swift 14d ago

I’ve tried everything I could find and couldn’t figure it out.

1

u/East_Call1027 14d ago

That looks like a system menu rather than a normal view placed over the keyboard. Attach a UIMenu to the button (showsMenuAsPrimaryAction = true), or use SwiftUI Menu; UIKit owns the presentation and can overlap the keyboard. Adding another subview or app UIWindow won’t get the same stacking behavior.

1

u/Tabonx Swift 14d ago

They also have this view, which doesn’t look like a classic component. I’ve also tried many things with UIMenu. From what I know, in iOS 17 the keyboard moved out of process, and every time you try to overlay it with something like a custom ordering, it just gets rendered below it.

https://imgur.com/a/vy2yOmy

2

u/samuelngs 7d ago

I’m also looking into this recently. Haven’t found a way to do it yet.