r/iOSProgramming • u/Puzzleheaded-Gain438 • Oct 09 '26
Question How does the ChatGPT app move the keyboard like that?
136
Upvotes
r/iOSProgramming • u/Puzzleheaded-Gain438 • Oct 09 '26
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.
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
72
u/StretchyPear Oct 09 '26
It keeps its input as first responder and animates the view
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/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/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.