         if #available(iOS 11.0, *) {
             scrollView?.contentInsetAdjustmentBehavior = .never
         }
+        NotificationCenter.default.addObserver(forName: Notification.Name.UIKeyboardWillChangeFrame, object: nil, queue: nil, using: { [weak self] notification in
+            if let endFrame = notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as? CGRect {
+                self?.keyboardFrame = self?.view.convert(endFrame, from: self?.view.window)
+            }
+            self?.updateScrollViewInsets()
+        })
     }
     
     override func viewWillAppear(_ animated: Bool) {

        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        apply(theme: theme)

            safeInsets = UIEdgeInsets(top: topLayoutGuide.length, left: 0, bottom: min(44, bottomLayoutGuide.length), right: 0) // MIN 44 is a workaround for an iOS 10 only issue where the bottom layout guide is too tall when pushing from explore
        }
        
        var bottom = safeInsets.bottom
        if let keyboardFrame = keyboardFrame {
            let keyboardHeight = view.bounds.height - keyboardFrame.minY
            bottom = max(bottom, keyboardHeight)
        }
        
        let scrollIndicatorInsets = UIEdgeInsets(top: top, left: safeInsets.left, bottom: bottom, right: safeInsets.right)
        if let rc = scrollView.refreshControl, rc.isRefreshing {
            top += rc.frame.height
