By John Gruber
Mux — Video API for developers. Build in one sprint or less.
Douglas Hill, following up on my piece yesterday on scrolling with standard keyboard shortcuts in UIKit and Catalyst apps:
I wish this was the case, but unfortunately it is not. The standard UIKit scrolling class, UIScrollView, does not provide any keyboard-driven scrolling functionality. […]
What’s going on here is that Apple did not add support for Page Up and Page Down in UIKit: They added this in WebKit/Safari. Fortunately WebKit is open source so we can see how they did it. Developers need to use the undocumented input strings
UIKeyInputPageUpandUIKeyInputPageDownand write their own code to scroll up or down by the correct amount in response to those input events. While WebKit doesn’t support Home and End it’s possible to do some guessing: The stringsUIKeyInputHomeandUIKeyInputEnddo in fact work.
Hill has an open source framework, KeyboardKit, to fill these gaps.
★ Friday, 20 December 2019