![](/img/trans.png)
[英]How to pass the returned Image of an AsyncImage object to a different view in SwiftUI?
[英]How to replace the cached AsyncImage with new image in ios
我有一個AsyncImageView
,它正在加載一個配置文件的圖像。一旦用戶更改了他/她的個人資料圖片,它將替換相同圖像URL中的圖像。
現在問題是它是從緩存加載舊圖像而不是用新圖像替換它。
任何人都可以提供幫助。這是我的代碼
[profImageView setImageURL:[NSURL URLWithString:imageURL]];
嘗試這個:
NSCache *cache = [AsyncImageLoader defaultCache];
[cache removeObjectForKey:[NSURL URLWithString:imageURL]];
[profImageView setImageURL:[NSURL URLWithString:imageURL]];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.