Protocols

The following protocols are available globally.

  • A type erased Equatable conformance. When defining a custom protocol which should conform to the Equatable protocol then comparing two instances of those protocol references still doesn’t work. Conform to this protocol instead to make it possible to compare two references.

    See more

    Declaration

    Swift

    public protocol AnyEquatable
  • The interface of the ApplicationManager which can be used to inject different implementations. Normally code should not be directly dependent upon the UIApplication because that might break UnitTests when running the tests on a device / simulator which differs from the test’s expectations. Therefore, code should get the UIApplication instance being injected and for tests it should be mocked. It’s expected that the implementation informs the ObservableObject of any value changes.

    See more

    Declaration

    Swift

    @MainActor
    public protocol ApplicationManager
  • The interface of the UIDeviceProvider which can be used to inject different implementations. Normally code should not be directly dependent upon the UIDevice because that might break UnitTests when running the tests on a device / simulator which differs from the test’s expectations. Therefore, code should get the UIDevice instance being injected and for tests it should be mocked. To make this possible this protocol provides the interface to the user interface idiom and the device orientation while the UIDeviceProvider provides an implementation which can be injected when running the code in the app and UIDeviceProviderMock a mock which can then be configured and injected in UnitTests. It’s expected that the implementation informs the ObservableObject of any value changes.

    See more

    Declaration

    Swift

    public protocol UIDeviceProviderType : ObservableObject