Last active
March 12, 2019 21:36
-
-
Save brandonasuncion/0e597d8a6fcbde19d314099560f2142f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CustomUrlProtocol: URLProtocol { | |
| static var requestCount = 0 | |
| open override class func canInit(with request: URLRequest) -> Bool { | |
| guard let url = request.url else { return false } | |
| requestCount = requestCount + 1 | |
| print("NSURLREQUEST: \(request)") | |
| return false | |
| } | |
| } | |
| URLProtocol.registerClass(CustomUrlProtocol.self) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment