title: Renamed issues in Swift
body: <p>I'm working on programming with Swift for the first time, and in doing so I'm following along with <a href="http://codewithchris.com/iphone-app-connect-to-mysql-database/" rel="nofollow noreferrer">this</a> tutorial. Unfortunately it looks like the tutorial is a little outdated and most of the code is throwing Buildtime errors. The most reoccurring error is the <code>NSURLSession has been renamed to URLSession</code>. I've tried letting Swift fix it, but in many cases it just starts throwing warnings.I'm also getting a <code>Value type HomeModel has no member'parseJSON'</code> error as well as a <code>NSDat is not implicitly convertible to data</code> error. From what I can tell, it looks like the NSURL is no longer used, but I'm not sure about the other two. Seeing how this is the first Swift project I've worked on, I'm not sure how to fix these. Can someone provide some insight on how to fix these mistakes?</p>
  
  <p>here is the code: </p>
  
  <pre><code>import Foundation
  
  protocol HomeModelProtocal: class {
      func itemsDownloaded(items: NSArray)
  }
  
  
  class HomeModel: NSObject, NSURLSessionDataDelegate {
  
      //properties
  
      weak var delegate: HomeModelProtocal!
  
      var data : NSMutableData = NSMutableData()
  
      let urlPath: String = "http://testurl.com/service.php" //this will be changed to the path where service.php lives
  
  
      func downloadItems() {
  
          let url: NSURL = NSURL(string: urlPath)!
          var session: NSURLSession!
          let configuration = NSURLSessionConfiguration.defaultSessionConfiguration()
  
  
          session = NSURLSession(configuration: configuration, delegate: self, delegateQueue: nil)
  
          let task = session.dataTaskWithURL(url)
  
          task.resume()
  
      }
  
      func URLSession(session: NSURLSession, dataTask: NSURLSessionDataTask, didReceiveData data: NSData) {
          self.data.appendData(data);
  
      }
  
      func URLSession(session: NSURLSession, task: NSURLSessionTask, didCompleteWithError error: NSError?) {
          if error != nil {
              print("Failed to download data")
          }else {
              print("Data downloaded")
              self.parseJSON()
          }
  
      }
  }
  </code></pre>