ios - How to Enable Local Storage in Web Application Swift View -
i developing small app in swift3 ios, developed android had problem replicated here. happens have webview have upload videos, youtube videos reproduced without problems (both android , ios), problem arises when want play video example jwplayer, problem had in android property not enabled write disk , solution follows:
final webview mybrowser; mybrowser.getsettings().setdomstorageenabled(true);
what solution swift3?
i found solution:
var prefs: webpreferences? = webview.prefereces prefs?._setlocalstoragedatabasepath("~/library/application support/myapp") prefs?.localstorageenabled = true
but error:
use of undeclared type webpreferences
i pay attention comments, greetings , many in advance.
i update question.
import uikit import webkit class viewcontroller: uiviewcontroller { @iboutlet var webview: webview! override func viewdidload() { super.viewdidload() webview.loadurl( string: "www.google.com") } class webview: wkwebview{ required init?(coder: nscoder) { if let _view = uiview(coder: coder){ super.init(frame: _view.frame, configuration: wkwebviewconfiguration()) autoresizingmask = _view.autoresizingmask }else{ return nil } } func loadurl(string: string){ if let url = url(string: string ) { load(urlrequest(url: url)) } } } }
Comments
Post a Comment