Protocols
The following protocols are available globally.
-
A type erased Equatable conformance. When defining a custom protocol which should conform to the
See moreEquatableprotocol 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 moreApplicationManagerwhich can be used to inject different implementations. Normally code should not be directly dependent upon theUIApplicationbecause that might break UnitTests when running the tests on a device / simulator which differs from the test’s expectations. Therefore, code should get theUIApplicationinstance being injected and for tests it should be mocked. It’s expected that the implementation informs theObservableObjectof any value changes.Declaration
Swift
@MainActor public protocol ApplicationManager -
The interface of the
See moreUIDeviceProviderwhich can be used to inject different implementations. Normally code should not be directly dependent upon theUIDevicebecause that might break UnitTests when running the tests on a device / simulator which differs from the test’s expectations. Therefore, code should get theUIDeviceinstance 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 theUIDeviceProviderprovides an implementation which can be injected when running the code in the app andUIDeviceProviderMocka mock which can then be configured and injected in UnitTests. It’s expected that the implementation informs theObservableObjectof any value changes.Declaration
Swift
public protocol UIDeviceProviderType : ObservableObject
View on GitHub
Protocols Reference