1

I want to have images downloaded by kingfisher and set as the image of my AnnotationView. The problem is that Kingfisher only seems to work on UIImageView's and the AnnotationView doesn't seem to expose its.

So one approach would be to use Kingfishers download mechanism to retrieve the image and set it by myself:

KingfisherManager.shared.retrieveImage(with: url) { result in 
    // Do something with `result`
}

But I'd rather want Kingfisher to set the image because with this approach I'd lose some of Kingfishers features (e.g. placeholder image).

How can I get a hold of the AnnotationView's ImageView?

Jochen
  • 88
  • 1
  • 9

1 Answers1

0

I've added an imageView to my annotationView. It works with great success.

let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 35, height: 42))
annotationView?.addSubview(imageView)
Ivan Le Hjelmeland
  • 1,065
  • 11
  • 26
  • I've done that too in the end, but struggled because I had to set the annotation view's size by hand then (before it was not visible): view.frame = CGRect(...) – Jochen Dec 31 '18 at 14:43