• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to enable local storage in WebView using Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to enable local storage in WebView using Swift


  • Subject: Re: How to enable local storage in WebView using Swift
  • From: Scott Ribe <email@hidden>
  • Date: Wed, 03 Jun 2015 08:31:56 -0600

On Jun 3, 2015, at 8: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,

I don't know Swift, nor much about WebViews, but I'd guess it's because you got the member name wrong. Try localStorageEnabled.

--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice






_______________________________________________

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


  • Follow-Ups:
    • Re: How to enable local storage in WebView using Swift
      • From: Juanjo Conti <email@hidden>
References: 
 >How to enable local storage in WebView using Swift (From: Juanjo Conti <email@hidden>)

  • Prev by Date: How to enable local storage in WebView using Swift
  • Next by Date: Re: Understanding the "declaration of instance variables in the interface is deprecated" warning.
  • Previous by thread: How to enable local storage in WebView using Swift
  • Next by thread: Re: How to enable local storage in WebView using Swift
  • Index(es):
    • Date
    • Thread