Skip to content

Commit

Permalink
animate address bar
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Oct 10, 2023
1 parent 7428d12 commit bc39498
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DuckDuckGo/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,9 @@ class MainViewController: UIViewController {

let navBarOffset = max(0, intersection.height - toolbarHeight)
self.viewCoordinator.constraints.navigationBarContainerBottom.constant = -navBarOffset

animateForKeyboard(userInfo: userInfo, y: view.frame.height - height)
self.animateForKeyboard(userInfo: userInfo, y: self.view.frame.height - height)
}

private func animateForKeyboard(userInfo: [AnyHashable: Any], y: CGFloat) {
let duration: TimeInterval = (userInfo[UIResponder.keyboardAnimationDurationUserInfoKey] as? NSNumber)?.doubleValue ?? 0
let animationCurveRawNSN = userInfo[UIResponder.keyboardAnimationCurveUserInfoKey] as? NSNumber
Expand All @@ -395,6 +394,7 @@ class MainViewController: UIViewController {
let frame = self.findInPageView.frame
UIView.animate(withDuration: duration, delay: 0, options: animationCurve, animations: {
self.findInPageView.frame = CGRect(x: 0, y: y - frame.height, width: frame.width, height: frame.height)
self.view.layoutSubviews()
}, completion: nil)

}
Expand Down

0 comments on commit bc39498

Please sign in to comment.