Skip to content

Commit

Permalink
[Issue Alamofire#721] Reverted respondsToSelector override removal in…
Browse files Browse the repository at this point in the history
… SessionDelegate.
  • Loading branch information
cnoon committed Sep 17, 2015
1 parent 689c9e8 commit a948026
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Source/Manager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -645,5 +645,26 @@ public class Manager {
var _streamTaskWriteClosed: Any?
var _streamTaskBetterRouteDiscovered: Any?
var _streamTaskDidBecomeInputStream: Any?

// MARK: - NSObject

public override func respondsToSelector(selector: Selector) -> Bool {
switch selector {
case "URLSession:didBecomeInvalidWithError:":
return (self.sessionDidBecomeInvalidWithError != nil)
case "URLSession:didReceiveChallenge:completionHandler:":
return (self.sessionDidReceiveChallenge != nil)
case "URLSessionDidFinishEventsForBackgroundURLSession:":
return (self.sessionDidFinishEventsForBackgroundURLSession != nil)
case "URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:":
return (self.taskWillPerformHTTPRedirection != nil)
case "URLSession:dataTask:didReceiveResponse:completionHandler:":
return (self.dataTaskDidReceiveResponse != nil)
case "URLSession:dataTask:willCacheResponse:completionHandler:":
return (self.dataTaskWillCacheResponse != nil)
default:
return self.dynamicType.instancesRespondToSelector(selector)
}
}
}
}

0 comments on commit a948026

Please sign in to comment.