apasccon / SearchTextField

UITextField subclass with autocompletion suggestions list
MIT License
1.15k stars 254 forks source link

Drop down list not disappearing when sliding the view up or down. #185

Open ankit7201 opened 4 years ago

ankit7201 commented 4 years ago

Once the drop down list becomes visible and instead of selecting something from the list, we start scrolling up or down, the drop down list stays on the screen. Calling "removeTableView()" doesn't work.

rebel-codeaz commented 3 years ago

@ankitarora93 implement scrollView delegate in your file and call the library method hideResultsList() in scrollViewDidScroll() and scrollViewWillBeginDragging(). this works fine! `extension ViewController : UIScrollViewDelegate {

    func scrollViewDidScroll(_ scrollView: UIScrollView) {
        self.yourTextField.hideResultsList()
    }

    func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
        self.yourTextField.hideResultsList()
    }
}`