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? {
|
func thumbnail(from path: String?) -> Image? {
|
||||||
guard let imagePath = path,
|
guard let imagePath = path else {
|
||||||
let url = URL(string: imagePath),
|
return Image(uiImage: UIImage(systemName: "globe")!)
|
||||||
let data = try? Data(contentsOf: url),
|
}
|
||||||
let uiImage = UIImage(data: data) else {
|
|
||||||
return Image(uiImage: UIImage(systemName: "globe")!)
|
let url = URL(fileURLWithPath: imagePath)
|
||||||
}
|
|
||||||
return Image(uiImage: uiImage)
|
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 {
|
func pubDate(_ dateString: String) -> String {
|
||||||
|
|
Loading…
Reference in New Issue