calling protocol method that is implemented by subclass from the superclass
<p>I have multiple <code>TableViewController</code> classes that inherit from a basic <code>TableViewController</code> class like this:</p>

<pre><code>class BasicTableViewController: UITableViewController {
}

class SpecificTableViewController: BasicTableViewController {
}

class AnotherSpecificTableViewController: BasicTableViewController {
}
</code></pre>

<p>then i created a very simple protocol to add refreshing capabilities to the specific viewcontroller classes like this:</p>

<pre><code>@objc
protocol Refreshable {
    func refresh()
}
</code></pre>

<p>my specific viewcontroller classes can implement the protocol like this:</p>

<pre><code>class SpecificTableViewController: BasicTableViewController, Refreshable {
    func refresh() {
        getSomeDataFromServer()
    }
}
</code></pre>

<p>the question now is: what is the correct way to call the refresh method from the <code>BasicTableViewController</code> which itself does not conform to the <code>Refreshable</code> protocol? right now i am doing something like this (without being sure if it's the way to go):</p>

<pre><code>class BasicTableViewController: UITableViewController {
    override func viewDidLoad() {
        super.viewDidLoad()

        if let _ = self as? Refreshable {
            let refreshControl = UIRefreshControl()
            refreshControl.addTarget(self, action: #selector(Refreshable.refresh), forControlEvents: .ValueChanged)
            self.refreshControl = refreshControl
        }
    }
}
</code></pre>

<p>at the very beginning i did not mark the protocol with <code>@objc</code> and tried to build the selector like this: <code>#selector(refresh)</code>. that did not work though. hope to get some clarification. :)</p>

<p>thanks in advance!</p>