iOS Branding Images
Custom Icons and Images can be provided by implementing a BrandingImagesProvider
protocol.
Depending on the usage, custom icons and images are provided as either Image
(for SwiftUI components) or UIImage
(for UIKit components). All images used by Capture are used as templates, and their color is changed based on BrandingColorProvider
(either default or custom):
- For
Image
the.renderingMode(.template)
setting is used. See Apple’s documentation - For
UIImage
thewithRenderingMode(.alwaysTemplate)
setting is used. See Apple’s documentation for more information.
The sizes of the images must match their usage in Capture UI. This can be achieved in multiple ways, for example by providing an Image Set , or providing a single image, which looks fine on larger and smaller devices.
BrandingImagesProvider
contains definitions for all images used by the SDK. All images used in Capture have the capture
prefix (the properties from captureAutoCaptureIconOff
to captureTipsSteadyIcon
alphabetically). If using the Standalone Capture, only those images with the capture
prefix need overriding.
Example
In the following example, the crop icon is overridden with the “crop” SF Symbol.
class MyImages: BrandingImagesProvider {
var capturePreviewCropIcon: UIImage {
UIImage(systemName: "crop")
}
}
let branding = Branding()
branding.images = MyImages()
// ...