import UIKit
import DATAStack
import Sync

class Networking {
    let AppNetURL = "https://api.app.net/posts/stream/global"
    let dataStack: DATAStack

    required init(dataStack: DATAStack) {
        self.dataStack = dataStack
    }

    func fetchItems(completion: (NSError?) -> Void) {
        let session = NSURLSession.sharedSession()
        let request = NSURLRequest(URL: NSURL(string: AppNetURL)!)
        session.dataTaskWithRequest(request, completionHandler: { data, response, error in
            if let data = data, json = (try? NSJSONSerialization.JSONObjectWithData(data, options: [])) as? [String: AnyObject] {
                Sync.changes(json["data"] as! Array,
                    inEntityNamed: "Data",
                    dataStack: self.dataStack,
                    completion: { error in
                        completion(error)
                })
            } else {
                completion(error)
            }
        }).resume()
    }
}

import UIKit
import DATAStack
import Sync

class Networking {
    let AppNetURL = "https://api.app.net/posts/stream/global"
    let dataStack: DATAStack

    required init(dataStack: DATAStack) {
        self.dataStack = dataStack
    }

    func fetchItems(completion: (NSError?) -> Void) {

        if let urlAppNet = NSURL(string: AppNetURL) {
            let request = NSURLRequest(URL: urlAppNet)
            let operationQueue = NSOperationQueue()

            NSURLConnection.sendAsynchronousRequest(request, queue: operationQueue) { [unowned self] _, data, error in
                if let data = data, json = (try? NSJSONSerialization.JSONObjectWithData(data,
                    options: NSJSONReadingOptions.MutableContainers)) as? Dictionary<String, AnyObject> {
                        Sync.changes(json["data"] as! Array,
                            inEntityNamed: "Data",
                            dataStack: self.dataStack,
                            completion: { error in
                                completion(error)
                        })
                } else {
                    completion(error)
                }
            }
        }
    }
}

--- 
+++ 
@@ -11,24 +11,19 @@
     }
 
     func fetchItems(completion: (NSError?) -> Void) {
-
-        if let urlAppNet = NSURL(string: AppNetURL) {
-            let request = NSURLRequest(URL: urlAppNet)
-            let operationQueue = NSOperationQueue()
-
-            NSURLConnection.sendAsynchronousRequest(request, queue: operationQueue) { [unowned self] _, data, error in
-                if let data = data, json = (try? NSJSONSerialization.JSONObjectWithData(data,
-                    options: NSJSONReadingOptions.MutableContainers)) as? Dictionary<String, AnyObject> {
-                        Sync.changes(json["data"] as! Array,
-                            inEntityNamed: "Data",
-                            dataStack: self.dataStack,
-                            completion: { error in
-                                completion(error)
-                        })
-                } else {
-                    completion(error)
-                }
+        let session = NSURLSession.sharedSession()
+        let request = NSURLRequest(URL: NSURL(string: AppNetURL)!)
+        session.dataTaskWithRequest(request, completionHandler: { data, response, error in
+            if let data = data, json = (try? NSJSONSerialization.JSONObjectWithData(data, options: [])) as? [String: AnyObject] {
+                Sync.changes(json["data"] as! Array,
+                    inEntityNamed: "Data",
+                    dataStack: self.dataStack,
+                    completion: { error in
+                        completion(error)
+                })
+            } else {
+                completion(error)
             }
-        }
+        }).resume()
     }
 }
Use NSURLSession instead of NSURLConnection
