How can I select the algolia search hits and redirect it to the desired Viewcontroller?

114 Views Asked by At

So I finally figured out how to setup Algolia search in my app. It felt good for 10 seconds when the hits showed up as I typed, but then I clicked one of the cells and realized it doesn't instantiate the TeacherDetailsViewController like how my normal cells did.

Here is my normal tableview. Tableview

This is the VC it instantiates with each event.

Event Details VC

When I select the cell in the Algolia search, this happens ... Algolia cell

Does anybody know how I can hook up those search result cells with the same VC I instantiate with my normal tableview cells?

Some extra code that will clarify the result cells.

struct NameOfEventTableViewCellConfigurator: TableViewCellConfigurable {



let model: NameOfEvent

init(model: NameOfEvent, indexPath: IndexPath) {
    self.model = model
}

func configure(_ cell: UITableViewCell) {
    cell.textLabel?.text = model.eventName
    cell.textLabel?.font = UIFont(name: Constants.CellDetails.fontName, size: 25)
    
}

}

0

There are 0 best solutions below