Skip to content

Commit

Permalink
Removed custom asyncMain function
Browse files Browse the repository at this point in the history
  • Loading branch information
Cornelius Horstmann committed Oct 2, 2017
1 parent 67aa1b9 commit d0a9aad
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions PiwikTracker/MainThread.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@ import Foundation
func assetMainThread(_ file: StaticString = #file, line: UInt = #line) {
assert(Thread.isMainThread, "\(file):\(line) must run on the main thread!")
}

public func asyncMain(_ block: @escaping () -> ()) {
DispatchQueue.main.async(execute: block)
}
2 changes: 1 addition & 1 deletion PiwikTracker/URLSessionDispatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class URLSessionDispatcher: Dispatcher {
self.baseURL = baseURL
self.timeout = 5
self.session = URLSession.shared
asyncMain {
DispatchQueue.main.async {
self.userAgent = userAgent ?? URLSessionDispatcher.defaultUserAgent()
}
}
Expand Down

0 comments on commit d0a9aad

Please sign in to comment.