forked from shadowfacts/Tusker
40 lines
1.1 KiB
Swift
40 lines
1.1 KiB
Swift
//
|
|
// FindInstanceViewController.swift
|
|
// Tusker
|
|
//
|
|
// Created by Shadowfacts on 12/19/19.
|
|
// Copyright © 2019 Shadowfacts. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
class FindInstanceViewController: InstanceSelectorTableViewController {
|
|
|
|
var instanceTimelineDelegate: InstanceTimelineViewControllerDelegate?
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
|
|
delegate = self
|
|
|
|
searchController.hidesNavigationBarDuringPresentation = false
|
|
|
|
navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancelButtonPressed))
|
|
}
|
|
|
|
// MARK: - Interaction
|
|
|
|
@objc func cancelButtonPressed() {
|
|
dismiss(animated: true)
|
|
}
|
|
|
|
}
|
|
|
|
extension FindInstanceViewController: InstanceSelectorTableViewControllerDelegate {
|
|
func didSelectInstance(url: URL) {
|
|
let instanceTimelineController = InstanceTimelineViewController(for: url)
|
|
instanceTimelineController.delegate = instanceTimelineDelegate
|
|
show(instanceTimelineController, sender: self)
|
|
}
|
|
}
|