diff --git a/AutoCat/Controllers/SearchController.swift b/AutoCat/Controllers/SearchController.swift index c760332..318856c 100644 --- a/AutoCat/Controllers/SearchController.swift +++ b/AutoCat/Controllers/SearchController.swift @@ -3,7 +3,7 @@ import RxDataSources import RxSwift import RxCocoa -class SearchController: UIViewController, UISearchResultsUpdating { +class SearchController: UIViewController, UISearchResultsUpdating, UITableViewDelegate { @IBOutlet weak var tableView: UITableView! @IBOutlet weak var showMapButton: UIBarButtonItem! @@ -62,6 +62,8 @@ class SearchController: UIViewController, UISearchResultsUpdating { .bind(to: self.tableView.rx.items(dataSource: ds)) .disposed(by: self.bag) } + + self.tableView.rx.setDelegate(self).disposed(by: self.bag) } // FIXME: Code duplication @@ -125,4 +127,22 @@ class SearchController: UIViewController, UISearchResultsUpdating { self.showMapButton.isEnabled = false self.filterRelay.accept(self.filter) } + + // MARK: - UITableViewDelegate + + func tableView(_ tableView: UITableView, contextMenuConfigurationForRowAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? { + //guard let vehicle = try? self.tableView.rx.model(at: indexPath) else { return } + + +// return UIContextMenuConfiguration(identifier: nil, previewProvider: nil) { _ in +// let update = UIAction(title: "Update", image: UIImage(systemName: "arrow.2.circlepath")) { action in +// //self.update(vehicle: vehicle) +// } +// let remove = UIAction(title: "Remove", image: UIImage(systemName: "trash"), attributes: [.destructive]) { action in +// //self.remove(vehicle: vehicle) +// } +// +// return UIMenu(title: "Actions", children: [update, remove]) +// } + } } diff --git a/AutoCat/Utils/Constants.swift b/AutoCat/Utils/Constants.swift index 34e7169..fd8bd02 100644 --- a/AutoCat/Utils/Constants.swift +++ b/AutoCat/Utils/Constants.swift @@ -3,9 +3,9 @@ import Foundation enum Constants { static var baseUrl: String { #if DEBUG - return "http://127.0.0.1:3000/" + //return "http://127.0.0.1:3000/" //return "http://192.168.1.67:3000/" - //return "https://vps.aliencat.pro:8443/" + return "https://vps.aliencat.pro:8443/" #else return "https://vps.aliencat.pro:8443/" #endif