Skip to content

Commit

Permalink
Move NetworkResultCallback inside the class
Browse files Browse the repository at this point in the history
This makes it more consistent
  • Loading branch information
jkmassel committed Mar 25, 2020
1 parent fac0f65 commit 09af253
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import Foundation

typealias NetworkResultCallback = (Result<Data?, Error>) -> Void

open class EventLoggingNetworkService {

typealias ResultCallback = (Result<Data?, Error>) -> Void

private let urlSession: URLSession

init(urlSession: URLSession = URLSession.shared) {
self.urlSession = urlSession
}

func uploadFile(request: URLRequest, fileURL: URL, completion: @escaping NetworkResultCallback) {
func uploadFile(request: URLRequest, fileURL: URL, completion: @escaping ResultCallback) {
urlSession.uploadTask(with: request, fromFile: fileURL, completionHandler: { data, response, error in

if let error = error {
Expand Down

0 comments on commit 09af253

Please sign in to comment.