Skip to content

Instantly share code, notes, and snippets.

@LukeSmith16
Last active April 3, 2023 13:59
Show Gist options
  • Save LukeSmith16/4b9c0eadd5ddd3f019f02a4647eb0aee to your computer and use it in GitHub Desktop.
Save LukeSmith16/4b9c0eadd5ddd3f019f02a4647eb0aee to your computer and use it in GitHub Desktop.
A public API for registering our subclassed URLProtocol; `UITestConnectionHandler`
public struct UITestConnectionManager {
public static func setMockedResponse(with response: MockResponse) {
UITestConnectionHandler.setAllowedResponse(with: response)
}
public static func register() {
URLProtocol.registerClass(UITestConnectionHandler.self)
}
public static func unregister() {
URLProtocol.unregisterClass(UITestConnectionHandler.self)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment