-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFeedRow.swift
42 lines (34 loc) · 1015 Bytes
/
FeedRow.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// FeedRow.swift
// iosApp
//
// Created by Ekaterina.Petrova on 11.11.2020.
// Copyright © 2020 orgName. All rights reserved.
//
import SwiftUI
import RssReader
import URLImage
struct FeedRow: View {
let feed: Feed
private enum Constants {
static let imageWidth: CGFloat = 20.0
}
var body: some View {
HStack {
if let imageUrl = feed.imageUrl, let url = URL(string: imageUrl) {
URLImage(url: url) { image in
image
.resizable()
.aspectRatio(contentMode: .fill)
}
.frame(width: Constants.imageWidth, height: Constants.imageWidth)
.clipped()
.cornerRadius(Constants.imageWidth / 2.0)
}
VStack(alignment: .leading, spacing: 5.0) {
Text(feed.title).bold().font(.title3).lineLimit(1)
Text(feed.desc).font(.body)
}
}
}
}