             }
         }
     }
+    
+    // MARK: - Prepare for draw table result
+    
+    fileprivate func prepareDrawTableResult() {
+        guard let frame = self.superview?.convert(self.frame, to: UIApplication.shared.keyWindow) else { return }
+        if let keyboardFrame = keyboardFrame {
+            var newFrame = frame
+            newFrame.size.height += theme.cellHeight
+            
+            if keyboardFrame.intersects(newFrame) {
+                direction = .up
+            } else {
+                direction = .down
+            }
+            
+            redrawSearchTableView()
+        }
+    }
 }
 
 extension SearchTextField: UITableViewDelegate, UITableViewDataSource {

        
        NotificationCenter.default.addObserver(self, selector: #selector(SearchTextField.keyboardWillShow(_:)), name: NSNotification.Name.UIKeyboardWillShow, object: nil)
        NotificationCenter.default.addObserver(self, selector: #selector(SearchTextField.keyboardWillHide(_:)), name: NSNotification.Name.UIKeyboardWillHide, object: nil)
    }
    
    override open func layoutSubviews() {
        super.layoutSubviews()
        
        buildSearchTableView()
        buildPlaceholderLabel()
        
        // Create the loading indicator
        indicator.hidesWhenStopped = true

    
    /// Indicate if this field has been interacted with yet
    open var interactedWith = false
    
    /// Indicate if keyboard is showing or not
    open var keyboardIsShowing = false

    /// Set your custom visual theme, or just choose between pre-defined SearchTextFieldTheme.lightTheme() and SearchTextFieldTheme.darkTheme() themes
    open var theme = SearchTextFieldTheme.lightTheme() {
