apasccon / SearchTextField

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

Sometimes isn't appearing #163

Open dfmarulanda opened 5 years ago

dfmarulanda commented 5 years ago

Sometimes when i'm doing a request, the SearchTextField doesn't appear even if there are items inside it.


 searchView.rx.text.orEmpty
      .debounce(0.5, scheduler: MainScheduler.instance)
      .distinctUntilChanged()
      .filterEmpty()
      .map { [unowned self] text in
        self.searchView.showLoadingIndicator()
        let request = MKLocalSearch.Request()
        request.naturalLanguageQuery = text
        request.region = self.mapView.region
        return request
      }
      .flatMapLatest{ MKLocalSearch(request:$0).rx.start() }
      .map { $0.mapItems }
      .filterEmpty()
      .asDriver(onErrorJustReturn: [])
      .drive( onNext:{ location in
        self.searchView.filterStrings(location.compactMap { $0.placemark.title } )
        self.searchView.stopLoadingIndicator()
        self.searchView.layoutIfNeeded()
      }).disposed(by:disposeBag)```
dfmarulanda commented 5 years ago

It seems that the response of my request doesn't match with the exact value of the word i entered into the textView.

dfmarulanda commented 5 years ago

@apasccon I see that you're not actively maintaining this repo; if you need help I can keep it updated.

apasccon commented 5 years ago

Hey! It will be totally appreciated!

El El mié, 23 ene. 2019 a las 20:03, Daniel Marulanda < notifications@github.com> escribió:

@apasccon https://github.com/apasccon I see that you're not actively maintaining this repo; if you need help I can keep it updated.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/apasccon/SearchTextField/issues/163#issuecomment-457001039, or mute the thread https://github.com/notifications/unsubscribe-auth/ACxuu2wR1jcPbMT8PX-Pg3ogXqCVLjMiks5vGOpegaJpZM4aNpiZ .

--

Alejandro Pasccon apasccon@gmail.com Skype: apasccon Mobile: +54 (9) 261 5789766