2 Replies
      Latest reply on Nov 11, 2016 10:29 AM by Phred
      Phred Level 1 Level 1 (0 points)

        Is URLSession init(configuration:delegate:delegateQueue:) Working

        when I try:

         

                var configuration = URLSessionConfiguration.default

                var session = URLSession(configuration: configuration, delegate: self, queue: nil)

         

        I get errors and XCode want me to change methods

        • Re: Is URLSession init(configuration:delegate:delegateQueue:) Working
          eskimo Apple Staff Apple Staff (9,090 points)

          When I put this code into a new iOS app test project, Xcode gives the following error:

          …/ViewController.swift:17:33: error: incorrect argument label in call (have 'configuration:delegate:queue:', expected 'configuration:delegate:delegateQueue:')
                  var session = URLSession(configuration: configuration, delegate: self, queue: nil)
                                          ^                                              ~~~~~
                                                                                        delegateQueue
          

          That seems pretty self explanatory and, if not, Xcode gives you a fix-it to make the change.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"