corrected ordering of guard for thumbnail
This commit is contained in:
parent
141ed4f915
commit
10a455399d
|
@ -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…
Reference in New Issue