【发布时间】:2019-06-13 21:31:01
【问题描述】:
我正在尝试将默认头像图像设置为“忍者”图像。但是,此代码未显示默认图像。不知道出了什么问题。
ProfileService.showOtherUser(user: bet.sentToUser) { [weak self] (profile2) in
self?.profile2 = profile2
if (profile2?.imageURL == "") {
cell.userImage.image = UIImage(named: "ninja")
}else{
let imageURL = URL(string: ((profile2?.imageURL ?? "")))
cell.userImage.kf.setImage(with: imageURL)
}
}
}
【问题讨论】:
-
检查文件名是否匹配正确(区分大小写)。另外,在主线程上执行。
-
文件名匹配
标签: swift database image default placeholder