Skip to content

Commit

Permalink
Merge pull request #17 from rajabishek/master
Browse files Browse the repository at this point in the history
Removes redundant addition of adding the block to run on the background thread
  • Loading branch information
Swift Code X committed Mar 16, 2016
2 parents 7bcbdee + 1c012fa commit d32ff79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 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
2 changes: 1 addition & 1 deletion SwiftRadio/StationsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class StationsViewController: UIViewController {

func setupPullToRefresh() {
self.refreshControl = UIRefreshControl()
self.refreshControl.attributedTitle = NSAttributedString(string: "Pull to refresh")
self.refreshControl.attributedTitle = NSAttributedString(string: "Pull to refresh", attributes: [NSForegroundColorAttributeName:UIColor.whiteColor()])
self.refreshControl.backgroundColor = UIColor.blackColor()
self.refreshControl.tintColor = UIColor.whiteColor()
self.refreshControl.addTarget(self, action: "refresh:", forControlEvents: UIControlEvents.ValueChanged)
Expand Down

0 comments on commit d32ff79

Please sign in to comment.