From 04d8748595e00c5e766b8ef62dfdf0bf90b29300 Mon Sep 17 00:00:00 2001 From: Christian Noon Date: Sun, 10 Apr 2016 10:45:56 -0700 Subject: [PATCH] Made SessionDelegate subscript public to allow full control when subclassing. --- Source/Manager.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Manager.swift b/Source/Manager.swift index 283fc11ab..362212546 100644 --- a/Source/Manager.swift +++ b/Source/Manager.swift @@ -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] }