@@ -68,8 +68,9 @@ class SearchResultsTableViewController: UITableViewController {
6868 object: nil )
6969
7070 // Set Up TableView
71- tableView. register ( PlaceTableViewCell . self, forCellReuseIdentifier: Constants . Cells. placeIdentifier)
7271 tableView. register ( UITableViewCell . self, forCellReuseIdentifier: Constants . Cells. seeAllStopsIdentifier)
72+ tableView. register ( UITableViewCell . self, forCellReuseIdentifier: Constants . Cells. currentLocationIdentifier)
73+ tableView. register ( PlaceTableViewCell . self, forCellReuseIdentifier: Constants . Cells. placeIdentifier)
7374 tableView. emptyDataSetSource = self
7475 tableView. tableFooterView = UIView ( )
7576 tableView. sectionIndexBackgroundColor = . clear
@@ -223,7 +224,13 @@ class SearchResultsTableViewController: UITableViewController {
223224
224225 var cell : UITableViewCell !
225226
226- if sections [ indexPath. section] . type == . seeAllStops {
227+ if sections [ indexPath. section] . type == . currentLocation {
228+ cell = tableView. dequeueReusableCell ( withIdentifier: Constants . Cells. currentLocationIdentifier)
229+ cell. textLabel? . text = Constants . General. currentLocation
230+ cell. imageView? . image = #imageLiteral( resourceName: " location " )
231+ }
232+
233+ else if sections [ indexPath. section] . type == . seeAllStops {
227234 cell = tableView. dequeueReusableCell ( withIdentifier: Constants . Cells. seeAllStopsIdentifier)
228235 cell. textLabel? . text = Constants . General. seeAllStops
229236 cell. imageView? . image = #imageLiteral( resourceName: " list " )
@@ -233,14 +240,9 @@ class SearchResultsTableViewController: UITableViewController {
233240 else {
234241 let place = sections [ indexPath. section] . items [ indexPath. row]
235242 cell = tableView. dequeueReusableCell ( withIdentifier: Constants . Cells. placeIdentifier) as? PlaceTableViewCell
236- ( cell as? PlaceTableViewCell ) ? . place = place
237243 cell. textLabel? . text = place. name
238-
239- if sections [ indexPath. section] . type == . currentLocation {
240- cell. imageView? . image = UIImage ( named: " location " )
241- } else {
242- cell. detailTextLabel? . text = place. description
243- }
244+ cell. detailTextLabel? . text = place. description
245+ ( cell as? PlaceTableViewCell ) ? . iconColor = place. type == . busStop ? Colors . tcatBlue : Colors . metadataIcon
244246 }
245247
246248 cell. textLabel? . font = . getFont( . regular, size: 14 )
0 commit comments