Protocols
The following protocols are available globally.
-
A type erased Equatable conformance. When defining a custom protocol which should conform to the
See moreEquatable
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.Declaration
Swift
public protocol AnyEquatable
-
The interface of the
See moreApplicationManager
which can be used to inject different implementations. Normally code should not be directly dependent upon theUIApplication
because that might break UnitTests when running the tests on a device / simulator which differs from the test’s expectations. Therefore, code should get theUIApplication
instance being injected and for tests it should be mocked. It’s expected that the implementation informs theObservableObject
of any value changes.Declaration
Swift
@MainActor public protocol ApplicationManager
-
The interface of the
See moreUIDeviceProvider
which can be used to inject different implementations. Normally code should not be directly dependent upon theUIDevice
because that might break UnitTests when running the tests on a device / simulator which differs from the test’s expectations. Therefore, code should get theUIDevice
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 theUIDeviceProvider
provides an implementation which can be injected when running the code in the app andUIDeviceProviderMock
a mock which can then be configured and injected in UnitTests. It’s expected that the implementation informs theObservableObject
of any value changes.Declaration
Swift
public protocol UIDeviceProviderType : ObservableObject