Skip to content

Commit

Permalink
Removes redundant addition of adding the block to run on the backgrou…
Browse files Browse the repository at this point in the history
…nd thread.
  • Loading branch information
rajabishek committed Mar 15, 2016
1 parent 9cf8a7f commit 1c58817
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SwiftRadio/DataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ class DataManager {

class func getDataFromFileWithSuccess(success: (data: NSData) -> Void) {

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {

let filePath = NSBundle.mainBundle().pathForResource("stations", ofType:"json")
if let filePath = NSBundle.mainBundle().pathForResource("stations", ofType:"json") {
do {
let data = try NSData(contentsOfFile:filePath!,
let data = try NSData(contentsOfFile:filePath,
options: NSDataReadingOptions.DataReadingUncached)
success(data: data)
} catch {
fatalError()
}
} else {
print("The local JSON file could not be found")
}
}

Expand Down

0 comments on commit 1c58817

Please sign in to comment.