up.
Also curious in how to override this value.
Claude Code offered these two solutions:
@objc private func reactOnKeyboardShowing() {
DispatchQueue.main.async {
UIView.animate(withDuration: 3) { [weak self] in
self?.rectangleHeightConstraint.constant = 20
self?.layoutIfNeeded()
}
}
}
@objc private func reactOnKeyboardShowing() {
let animator = UIViewPropertyAnimator(duration: 3, curve: .easeInOut) { [weak self] in
self?.rectangleHeightConstraint.constant = 20
self?.layoutIfNeeded()
}
animator.startAnimation()
}
But it feels like the animation happens after the keyboard appears, not after it started launching...
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: