As the question says, I am trying to access a variable of my ViewController inside my AppDelegate.swift.
in func applicationWillTerminate(_ application: UIApplication){}
, I want to access a WebSocket object inside my ViewController and do socket.disconnect(), so that the socket is disconnecting when my application is going to get shut downed.
I already searched the net for quite a bit but nothing seemed to help me in this situation.