TTAnnotationImage with custom generated image

I see that TTAnnotationImage only takes an image file name that’s included in the assets of the app. But for my use case I want to generate a distinct image for my annotations based on a set of features the place has. I am able to create an image with success but I wasn’t able to assign it to a TTAnnotation. Any help is appreciated!

If I understand correctly you generate images and the results are UIImage objects?
I think I have a solution for you
In the TTAnnotationImage.h file you will find the method:

/**
 Init TTAnnotationImage class with PNG image by UIImage
 @param image UIImage obejct
 @return TTAnnotationImage class
 */
+ (TTAnnotationImage *_Nullable)createPNGWithUIImage:(UIImage *_Nonnull)image;

use it to pass a UIImage as an Annotation image.
example code: (UIImage generator with UICollor from stackoverflow )

public extension UIImage {
    convenience init?(color: UIColor, size: CGSize = CGSize(width: 1, height: 1)) {
      let rect = CGRect(origin: .zero, size: size)
      UIGraphicsBeginImageContextWithOptions(rect.size, false, 0.0)
      color.setFill()
      UIRectFill(rect)
      let image = UIGraphicsGetImageFromCurrentImageContext()
      UIGraphicsEndImageContext()
      guard let cgImage = image?.cgImage else { return nil }
      self.init(cgImage: cgImage)
    }
  }

code in your app to pass UIImage as annotation:

        let redImage10x10 = UIImage(color: .red, size: CGSize(width: 10, height: 10))! // <-- UIImage Object
        let cooridnate = CLLocation.makeRandomCoordinateForCenteroid(center: TTCoordinate.AMSTERDAM())
        let customIcon = TTAnnotationImage.createPNG(with: redImage10x10)!
        let annotation = TTAnnotation(coordinate: cooridnate, annotationImage: customIcon, anchor: .bottom, type: .decal)
        mapView.annotationManager.add(annotation)