Skip to content

URLSessionTask conforms to ProgressReporting protocol, added new instance properties. #1175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Foundation/URLSession/URLSessionTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
import CoreFoundation
import Dispatch


/// A cancelable object that refers to the lifetime
/// of processing a given request.
open class URLSessionTask : NSObject, NSCopying {

public var countOfBytesClientExpectsToReceive: Int64 { NSUnimplemented() }
public var countOfBytesClientExpectsToSend: Int64 { NSUnimplemented() }
public var earliestBeginDate: Date? { NSUnimplemented() }

/// How many times the task has been suspended, 0 indicating a running task.
internal var suspendCount = 1
internal var session: URLSessionProtocol! //change to nil when task completes
Expand Down Expand Up @@ -328,6 +332,12 @@ extension URLSessionTask {
}
}

extension URLSessionTask : ProgressReporting {
public var progress: Progress {
NSUnimplemented()
}
}

internal extension URLSessionTask {
/// Updates the (public) state based on private / internal state.
///
Expand Down