Skip to content

Commit

Permalink
Made SessionDelegate subscript public to allow full control when subc…
Browse files Browse the repository at this point in the history
…lassing.
  • Loading branch information
cnoon committed Apr 10, 2016
1 parent 971e2f8 commit 04d8748
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/Manager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ public class Manager {
private var subdelegates: [Int: Request.TaskDelegate] = [:]
private let subdelegateQueue = dispatch_queue_create(nil, DISPATCH_QUEUE_CONCURRENT)

subscript(task: NSURLSessionTask) -> Request.TaskDelegate? {
/// Access the task delegate for the specified task in a thread-safe manner.
public subscript(task: NSURLSessionTask) -> Request.TaskDelegate? {
get {
var subdelegate: Request.TaskDelegate?
dispatch_sync(subdelegateQueue) { subdelegate = self.subdelegates[task.taskIdentifier] }
Expand Down

0 comments on commit 04d8748

Please sign in to comment.