title: Accepting cookies by default in Swift UIWebview
body: <p>I'm trying to test a url within a webview in swift in Xcode 6.1 that requires cookies, and I'm having issues with accepting cookies by default.</p>
  
  <p>Previously, in Objective-C, I had the following working:</p>
  
  <pre><code>[NSHTTPCookieStorage sharedHTTPCookieStorage].cookieAcceptPolicy = NSHTTPCookieAcceptPolicyAlways;
  NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:self.URL];
  [request setHTTPShouldHandleCookies:YES];
  [self.webView loadRequest:request];
  </code></pre>
  
  <p>Here is my test with Swift that throws an error about the cookie policy:</p>
  
  <pre><code>@IBOutlet var webView: UIWebView!
  override func viewDidLoad() {
      super.viewDidLoad()
      let url = NSURL(string: "http://testlink.com/")
      let request = NSMutableURLRequest(URL: url!)
      request.HTTPShouldHandleCookies = true
      webView.loadRequest(request)
  }
  </code></pre>
  
  <p>A note, the url that I end up at is not the one initially loaded. It has to be navigated to through a login.</p>
  
  <p>Any help porting this over would be much appreciated.</p>