Hijackr is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'Hijackr'
To register:
Hijackr.register()
To unregister:
Hijackr.unregister()
To hijack a request:
Hijackr.hijack(request: request, with: response)
Example:
let request = URLRequest(url: URL(string: "https://www.google.com")!)
let response = Hijackr.Response(statusCode: 200, body: "hello".data(using: .utf8))
Hijackr.hijack(request: request, with: response)
Test Cases can be found here
michaelhenry, me@iamkel.net
Hijackr is available under the MIT license. See the LICENSE file for more info.