mas/MasKit/Network/URLSession+NetworkSession.swift
2019-01-06 12:26:08 -07:00

18 lines
451 B
Swift

//
// URLSession+NetworkSession.swift
// MasKit
//
// Created by Ben Chatelain on 1/5/19.
// Copyright © 2019 mas-cli. All rights reserved.
//
import Foundation
extension URLSession: NetworkSession {
@objc open func loadData(from url: URL, completionHandler: @escaping (Data?, Error?) -> Void) {
let task = dataTask(with: url) { (data, _, error) in
completionHandler(data, error)
}
task.resume()
}
}