Chromecast listener is not working when i create seperate class from Controller
<p>Created class: </p>

<pre><code>class ChromeCast:NSObject {

    //MARK:Chromecast Vars
    var applicationMetadata: GCKApplicationMetadata?
    var selectedDevice: GCKDevice?
    var deviceManager: GCKDeviceManager?
    var mediaInformation: GCKMediaInformation?
    var mediaControlChannel: GCKMediaControlChannel?
    var deviceScanner: GCKDeviceScanner

    lazy var kReceiverAppID:String = {
        // You can add your own app id here that you get by registering with the
        // Google Cast SDK Developer Console https://cast.google.com/publish
        return kGCKMediaDefaultReceiverApplicationID
    }()


    override init() {

        let filterCriteria = GCKFilterCriteria(forAvailableApplicationWithID:
            kGCKMediaDefaultReceiverApplicationID)
        deviceScanner = GCKDeviceScanner(filterCriteria:filterCriteria)

    }

    func startChromeCastScanning() {
        // Initialize device scanner
        deviceScanner.addListener(self)
        deviceScanner.startScan()
        deviceScanner.passiveScan = false
        Log.Info("Start Scanning")
    }


}


extension ChromeCast: GCKDeviceScannerListener {

    func deviceDidComeOnline(device: GCKDevice!) {
        Log.Info("Device found: \(device.friendlyName)")

    }

    func deviceDidGoOffline(device: GCKDevice!) {
        Log.Info("Device went away: \(device.friendlyName)")

    }

}
</code></pre>

<p>and calling it from my view controller as:</p>

<pre><code>someFunctionInViewController() {

 let chrome = ChromeCast()
 chrome.startChromeCastScanning()
}
</code></pre>

<p>Delegate is not getting called back . when device discovered.</p>

<p>But same works when i add all properties and function in view controller it self.
But i want to seperate it from controller. what is the issue?</p>