Re: How to enable local storage in WebView using Swift
Re: How to enable local storage in WebView using Swift
- Subject: Re: How to enable local storage in WebView using Swift
- From: Conrad Shultz <email@hidden>
- Date: Sat, 27 Jun 2015 14:58:28 -0700
> On Jun 3, 2015, at 7:23 AM, Juanjo Conti <email@hidden> wrote:
>
> Hi, I'm using WebView and I'd like to enable HTML5 local storage.
>
> I've read some questions on Stack Overflow where the suggestion is to do:
>
> WebPreferences *prefs = [webView preferences];
> [prefs _setLocalStorageDatabasePath:@"~/Library/Application
> Support/MyApp"];
> [prefs setLocalStorageEnabled:YES];
>
> but if I try something similar in Swift:
>
> webView.preferences._setLocalStorageDatabasePath(LocalStoragePath)
> webView.preferences.localStorage = true
> I get a "WebPreferences does not have a member named ..." error.
>
> How can I do it?
>
> Thanks in advance,
If you can target Yosemite and newer, you can use WKWebView (instead of WebView), and HTML 5 local storage should just work. If it doesn't, or if this is insufficient for your needs, please file a bug report!
-Conrad
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden