Merge pull request #3635 from stuartbreckenridge/ios-candidate
corrected ordering of guard for thumbnail
This commit is contained in:
commit
28cd2fc0cf
@ -54,13 +54,18 @@ struct ArticleItemView: View {
|
||||
}
|
||||
|
||||
func thumbnail(from path: String?) -> Image? {
|
||||
guard let imagePath = path,
|
||||
let url = URL(string: imagePath),
|
||||
let data = try? Data(contentsOf: url),
|
||||
let uiImage = UIImage(data: data) else {
|
||||
return Image(uiImage: UIImage(systemName: "globe")!)
|
||||
}
|
||||
return Image(uiImage: uiImage)
|
||||
guard let imagePath = path else {
|
||||
return Image(uiImage: UIImage(systemName: "globe")!)
|
||||
}
|
||||
|
||||
let url = URL(fileURLWithPath: imagePath)
|
||||
|
||||
guard let data = try? Data(contentsOf: url),
|
||||
let uiImage = UIImage(data: data) else {
|
||||
return Image(uiImage: UIImage(systemName: "globe")!)
|
||||
}
|
||||
|
||||
return Image(uiImage: uiImage)
|
||||
}
|
||||
|
||||
func pubDate(_ dateString: String) -> String {
|
||||
|
Loading…
x
Reference in New Issue
Block a user