pradyumnad/SearchHUD

Linking the results to another ViewController

Opened this issue · 1 comments

Really great work by the way. I was hoping you could help me with a quick question that has been troubling me for weeks. I basically need a text search control of a NSArray list, (like SearchHUD). The issue I'm having is trying to get a result that has been filtered to go to a specific View Controller, either via a segue or Xib file. For example, in your SearchHUB, the user types in "f", then "France" appears. I would then like to have when the user then clicks "France" from the filtered list, to go to my already created FranceViewController. If they searched "Germany", once clicked it would go to the GermanyViewController I created. You now have it currently setup so when the user clicks "France", it goes back to the main ViewController and loads the data of "France" into the label of that view.

Please let me know if that makes sense, any help is greatly appreciated! I have spent much time trying to figure this out.

Thanks!

Michael

The below delegates will be helpful to do any decisions.

#pragma mark -
#pragma mark SearchHUD

- (void)didSelectRowAtIndex:(NSUInteger)index {
    NSLog(@"Index of Tapped item : %lu", (unsigned long) index);
    _countryLabel.text = (self.items)[index];
}

- (void)didSelectItem:(NSString *)item {
    NSLog(@"Selected Item %@", item);
    _countryLabel.text = item;
}

In - (void)didSelectRowAtIndex:(NSUInteger)index; method just write a switch case and present the controller you wanted to show for the selected index/item