Last active
April 3, 2023 13:59
-
-
Save LukeSmith16/4b9c0eadd5ddd3f019f02a4647eb0aee to your computer and use it in GitHub Desktop.
A public API for registering our subclassed URLProtocol; `UITestConnectionHandler`
This file contains 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
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