Я установил тип активности, как показано ниже.Я использую его, чтобы показать изображение в маркере на Картах Google
infoView.userImage.kf.indicatorType = .activity
, оно не анимируется и не исчезает после загрузки изображения.если я щелкну снаружи маркера и нажму назад, то найду изображение было загружено.Я даже пытаюсь установить значение none после загрузки загруженного изображения, но безрезультатно
ImageCache.default.retrieveImage(forKey: key!, options: [.fromMemoryCacheOrRefresh]) {
image, cacheType in
if let image = image {
//image found in cache so use it to create cell
infoView.userImage.image = image
infoView.userImage.kf.indicatorType = .none
} else {
//image not found in cache so below method retrieves and on successful retrieval, stores in cache
infoView.userImage.kf.setImage(with: url,
placeholder: nil,
options: [.transition(ImageTransition.fade(1))],
progressBlock: { receivedSize, totalSize in },
completionHandler: { image, error, cacheType, imageURL in
if error != nil {
ImageCache.default.store(UIImage(), forKey: key!)
infoView.userImage.kf.indicatorType = .none
} else {
ImageCache.default.store(image!, forKey: key!)
infoView.userImage.kf.indicatorType = .none
}
}
)
} //end of else
} //end of ImageCache.default.retrieveImage
Спасибо Ashish