imageWithConfiguration_ method
Create a new image by replacing the existing configuration with a new one. For symbol images this will always result in an image with a UIImageSymbolConfiguration, even if you give it another type of configuration (the trait info from the new configuration will be merged into the current symbol configuration resulting in anew symbol configuration). For non-symbol images, this will replace the configuration of the image with a new one.
Important note! Given (for example):
image = image(named:"the_image").withRenderingMode(.alwaysTemplate)
the following two statements aren't exactly equivalent:
a = image.imageAsset.withConfiguration(configuration) b = image.withConfiguration(configuration)
The first one will resolve the image again from the asset catalog (if it is originating from one),
resulting in a fresh image without any modifications. In other words, a won't have the
rendering mode change set anymore, and it will be "reverted" to .automatic.
The second one will resolve the image, but apply and changes that were made to the image.
That means that b might be a different image, but it will still have the same rendering mode
as image.
Implementation
UIImage imageWithConfiguration_(UIImageConfiguration configuration) {
final _ret = _objc_msgSend_62nh5j(this.ref.pointer, _sel_imageWithConfiguration_, configuration.ref.pointer);
return UIImage.castFromPointer(_ret, retain: true, release: true);
}