Context menu for search results
This commit is contained in:
parent
65d78c12d8
commit
cb71fd16bb
@ -3,7 +3,7 @@ import RxDataSources
|
|||||||
import RxSwift
|
import RxSwift
|
||||||
import RxCocoa
|
import RxCocoa
|
||||||
|
|
||||||
class SearchController: UIViewController, UISearchResultsUpdating {
|
class SearchController: UIViewController, UISearchResultsUpdating, UITableViewDelegate {
|
||||||
|
|
||||||
@IBOutlet weak var tableView: UITableView!
|
@IBOutlet weak var tableView: UITableView!
|
||||||
@IBOutlet weak var showMapButton: UIBarButtonItem!
|
@IBOutlet weak var showMapButton: UIBarButtonItem!
|
||||||
@ -62,6 +62,8 @@ class SearchController: UIViewController, UISearchResultsUpdating {
|
|||||||
.bind(to: self.tableView.rx.items(dataSource: ds))
|
.bind(to: self.tableView.rx.items(dataSource: ds))
|
||||||
.disposed(by: self.bag)
|
.disposed(by: self.bag)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.tableView.rx.setDelegate(self).disposed(by: self.bag)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Code duplication
|
// FIXME: Code duplication
|
||||||
@ -125,4 +127,22 @@ class SearchController: UIViewController, UISearchResultsUpdating {
|
|||||||
self.showMapButton.isEnabled = false
|
self.showMapButton.isEnabled = false
|
||||||
self.filterRelay.accept(self.filter)
|
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])
|
||||||
|
// }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,9 +3,9 @@ import Foundation
|
|||||||
enum Constants {
|
enum Constants {
|
||||||
static var baseUrl: String {
|
static var baseUrl: String {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
return "http://127.0.0.1:3000/"
|
//return "http://127.0.0.1:3000/"
|
||||||
//return "http://192.168.1.67:3000/"
|
//return "http://192.168.1.67:3000/"
|
||||||
//return "https://vps.aliencat.pro:8443/"
|
return "https://vps.aliencat.pro:8443/"
|
||||||
#else
|
#else
|
||||||
return "https://vps.aliencat.pro:8443/"
|
return "https://vps.aliencat.pro:8443/"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user