SpeedTestDelegate

public protocol SpeedTestDelegate : AnyObject

A protocol for receiving updates from a speed test.

  • Called when an error occurs during the speed test.

    Declaration

    Swift

    func speedTestDidFail(with error: Error)

    Parameters

    error

    The error that occurred.

  • Called periodically to report the current download speed and elapsed time.

    Declaration

    Swift

    func speedTestDidChangeProgress(instantaneousMbps: Double, elapsedMs: TimeInterval)

    Parameters

    instantaneousMbps

    The current download speed in megabits per second (Mbps).

    elapsedMs

    The elapsed time in milliseconds since the start of the test.

  • Called when the speed test is complete.

    Declaration

    Swift

    func speedTestDidComplete(with result: SpeedTestResult)

    Parameters

    result

    The result of the speed test, containing average speed and other metrics.