r/iOSProgramming • • Oct 09 '26

Question How does the ChatGPT app move the keyboard like that?

Post image
136 Upvotes

27 comments sorted by

46

u/Puzzleheaded-Gain438 Oct 10 '26

I think I figured it out. When revealing the sidebar, they snapshot the keyboard window and use the snapshot view as the textfield inputView. When closing the sidebar, they just remove the inputView.
What made me think it’s a snapshot was opening the sidebar and then changing the system theme. If it’s light at the beginning and I change to dark, the “keyboard” stays light for a while.

33

u/AnotherThrowAway_9 Oct 10 '26

You think or you know? I thought the keyboard was 'out of process' and thus not snap shottable by the app?

7

u/Awric Oct 10 '26

Ahh interesting. I’ve always wondered what the use case of snapshotView is for years now

0

u/LeoniFrancesco Oct 13 '26

I don't think so because the input caret is blinking

-19

u/TechieRandomGuy Oct 10 '26

It’s crazy the level of detail they have in OpenAI. I would love to work there

0

u/[deleted] Oct 12 '26

[deleted] — view deleted comment

1

u/Slimxshadyx Oct 23 '26

What a specific scenario your created designed to lessen that dude’s excitement for no reason

20

u/lltejasll Oct 10 '26

its the same thing that they are doing with this thinking slider as well, found a tweet regarding this https://x.com/zats/status/2092579372876149200

9

u/Puzzleheaded-Gain438 Oct 10 '26

Nice! This is definitely it.
It’s crazy how they can get away with their use of private APIs.

1

u/livingtech Oct 12 '26

Appreciate you actually found an answer, and didn't just post some off-the-cuff guess like half the other jokers here. LOL

72

u/StretchyPear Oct 09 '26

It keeps its input as first responder and animates the view

122

u/MichiganEngineExpo Oct 09 '26 • Diamonds are Forever Bravo Popcorn

Or it gets the hose again

3

u/anshumahipal Oct 10 '26

Ask chat gpt itself

7

u/pp_amorim Oct 09 '26

Probably new on iOS 27, doesn't work on 18.

Correction: only works with native keyboard.

6

u/m1_weaboo Oct 10 '26

UIKit

1

u/xSash_ UIKit Oct 25 '26

Yes indeed

0

u/icy1007 Oct 15 '26

I doubt it’s using UIKit.

1

u/big-phallus Oct 10 '26

Most importantly: where’s your dot??

1

u/chokingduckduck Oct 14 '26

Very likely it is a screenshot And with AI, they can enumerate all different formats of the phone

1

u/zellJun1or Foundation Oct 14 '26 edited Oct 14 '26

Def private apis, given that their keyboard has other interesting features that are not possible within available API

1

u/zellJun1or Foundation Oct 14 '26

Given that they use private api to render an in process keyboard, I think they can track everything that is typed

2

u/NZRedditUser Oct 14 '26

most likely the goal they had

1

u/simply_stupid_noor Oct 16 '26

Does not work with google keyboard

1

u/MarkoKrulc Oct 16 '26

vibecoded :D

-1

u/sarrafco Oct 10 '26

Maybe it takes a screenshot of the keyboard frame just before sliding the view and then shows it as an image.