i'm working vk api. want token when page finished load. how this? , how send token controller?
class loginviewcontroller: uiviewcontroller { var _webview: wkwebview override func viewdidload() { super.viewdidload() self.view.addsubview(_webview) _webview.settranslatesautoresizingmaskintoconstraints(false) let height = nslayoutconstraint(item: _webview, attribute: .height, relatedby: .equal, toitem: view, attribute: .height, multiplier: 1, constant: 0) let width = nslayoutconstraint(item: _webview, attribute: .width, relatedby: .equal, toitem: view, attribute: .width, multiplier: 1, constant: 0) self.view.addconstraints([height, width]) let url = nsurl(string: "https://oauth.vk.com/authorize?client_id=4876947&scope=audio&redirect_uri=https://oauth.vk.com/blank.html&display=mobile&v=5.30&response_type=token") let request = nsurlrequest(url : url!) _webview.loadrequest(request) } required init(coder adecoder: nscoder) { self._webview = wkwebview(frame: cgrectzero) super.init(coder: adecoder) } }