~/talk

Keyboard avoiding in SwiftUI

Talkat Mobius 2022 Autumn · 2022-11-09..11-21· [ios]
links:none on file
slides:none on file

Compares several open source approaches, finds their animations out of sync with the keyboard and extra gestures cause bugs, then builds a custom keyboard avoiding solution that combines a UIKit controller wrapper around SwiftUI views with keyboard notifications taken from userInfo so animation duration and curve match exactly. It detects the first responder, finds the enclosing scroll view, scrolls the active field into view and respects a bottom content padding. Result synchronizes animations with the keyboard and fixes many edge cases while keeping scroll interaction intact.

AI-written summary · about

  1. 0:00Welcome
  2. 1:05Speaker intro
  3. 2:07Keyboard problem in SwiftUI
  4. 3:09Third-party libraries overview
  5. 4:59KeyboardObserving testing
  6. 6:02Animation bugs
  7. 7:10First library findings
  8. 7:53KeyboardToolbar overview
  9. 8:54Library code analysis
  10. 10:17Performance issues
  11. 11:00KeyboardToolbar testing
  12. 12:48Second library findings
  13. 13:54Keyboard problem pre-SwiftUI
  14. 14:18Apple’s iOS 14 solution
  15. 15:25ScrollView and TextField issues
  16. 16:33Keyboard animation setup
  17. 17:36Standard solution limits
  18. 18:20Library and animation issues
  19. 19:43Custom solution plan
  20. 20:04Disabling standard input
  21. 20:27KeyboardController usage
  22. 21:54Padding approach
  23. 23:01Why KeyboardController
  24. 24:07Modal window issues
  25. 25:31Content padding setup
  26. 26:34Main algorithm
  27. 27:17Solution test results
  28. 28:22ScrollView part two
  29. 29:08ScrollView animation issues
  30. 30:35Finding first responder
  31. 31:42Finding ScrollView in hierarchy
  32. 32:44Nested ScrollView issues
  33. 33:27Keyboard distance setup
  34. 34:54UIKit TextField issues
  35. 35:17ScrollView findings
  36. 36:02KeyboardScrollAdvocator bonus
  37. 37:10Ending text editing
  38. 38:40SiteReporter bonus
  39. 39:45Conclusion and experiments
  40. 40:07Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.