-
Notifications
You must be signed in to change notification settings - Fork 0
/
WeatherRow.swift
41 lines (34 loc) · 949 Bytes
/
WeatherRow.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
40
41
//
// WeatherRow.swift
// WeatherApp
//
// Created by Stephanie Diep on 2021-11-30.
//
import SwiftUI
struct WeatherRow: View {
var logo: String
var name: String
var value: String
var body: some View {
HStack(spacing: 20) {
Image(systemName: logo)
.font(.title2)
.frame(width: 20, height: 20)
.padding()
.background(Color(hue: 1.0, saturation: 0.0, brightness: 0.888))
.cornerRadius(50)
VStack(alignment: .leading, spacing: 8) {
Text(name)
.font(.caption)
Text(value)
.bold()
.font(.title)
}
}
}
}
struct WeatherRow_Previews: PreviewProvider {
static var previews: some View {
WeatherRow(logo: "thermometer", name: "Feels like", value: "8°")
}
}