Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update KeyboardObserver #463

Merged
merged 4 commits into from
Sep 1, 2023
Merged

Conversation

robmaceachern
Copy link
Member

@robmaceachern robmaceachern commented Aug 2, 2023

This updates the KeyboardObserver to match the more recent implementation we use elsewhere.

Changes include:

  • A global KeyboardObserver
  • Support for the iOS 16.1+ changes related to the screen coordinate space. This can impact reported values when the app isn't full screen in Split View, Slide Over, and Stage Manager.
  • The delegate has been changed to report the UIView.AnimationCurve instead of UIView.AnimationOptions
  • ScrollerWrapperView changes:
    • The global KeyboardObserver is used instead of a per-instance observer. This might actually fix issues if this view is instantiated when the keyboard is already presented.
    • We now use a UIViewPropertyAnimator instead of UIView.animate when responding to keyboard notifications.

Note: This doesn't add any automatic initialization of the shared observer on launch. It might make sense to do that but I'd like to consider that separate from this impl sync-up.

) {
UIView.animate(withDuration: animationDuration, delay: 0.0, options: options, animations: {
UIViewPropertyAnimator(duration: animationDuration, curve: animationCurve) {
Copy link
Member Author

@robmaceachern robmaceachern Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could stick with UIView.animate - we'd just need to do a UIView.AnimationOptions(rawValue: ... << 16).

@robmaceachern robmaceachern marked this pull request as ready for review August 4, 2023 20:39
@robmaceachern robmaceachern requested a review from a team as a code owner August 4, 2023 20:39
@robmaceachern robmaceachern merged commit 13309a5 into main Sep 1, 2023
5 checks passed
@robmaceachern robmaceachern deleted the robmaceachern/keyboard-observer-updates branch September 1, 2023 19:38
kyleve added a commit that referenced this pull request Mar 16, 2024
…ller

* origin/main: (62 commits)
  AccessibilityBlocker aggressively blocking. (#483)
  Bumping version to 3.0.0 (#482)
  Allow for customization of the preview name (#478)
  Update CHANGELOG for AttributedLabel fixes (#480)
  Fix link detection for stretched labels (#476)
  chore: Updated minimum deployment target from iOS 14 to iOS 15 [UI-5185] (#479)
  chore(ios): Bump to Xcode 15.1 and Ruby 3.2.2 [UI-5184] (#477)
  AXCustomContent Support (#471)
  Bumping versions to 2.2.0 (#470)
  Update concatenation logic and unit tests
  update changelog
  never cache subelements
  optionally do not cache subelements
  Feature: add TintAdjustmentMode, modifiers, and tests
  Add to CHANGELOG
  Add tintAdjustmentMode to Image
  Bumping versions to 2.1.0 (#466)
  Resolved a Swift 5.9 compilation warning (#465)
  Update KeyboardObserver (#463)
  Bump activesupport from 7.0.4.3 to 7.0.7.2
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants