-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathCertificateRow.swift
56 lines (48 loc) · 1.31 KB
/
CertificateRow.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// CertificateRow.swift
// DesignCode
//
// Created by Mithun x on 7/15/19.
// Copyright © 2019 Mithun. All rights reserved.
//
import SwiftUI
struct CertificateRow: View {
var certificates = certificateData
var body: some View {
VStack(alignment: .leading) {
Text("Certificates")
.font(.system(size: 20))
.fontWeight(.heavy)
.padding(.leading, 30)
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 20) {
ForEach(certificates) { item in
CertificateView(item: item)
}
}
.padding(20)
.padding(.leading, 10)
}
}
}
}
#if DEBUG
struct CertificateRow_Previews: PreviewProvider {
static var previews: some View {
CertificateRow()
}
}
#endif
struct Certificate: Identifiable {
var id = UUID()
var title: String
var image: String
var width: Int
var height: Int
}
let certificateData = [
Certificate(title: "UI Design", image: "Certificate1", width: 230, height: 150),
Certificate(title: "SwiftUI", image: "Certificate2", width: 230, height: 150),
Certificate(title: "Sketch", image: "Certificate3", width: 230, height: 150),
Certificate(title: "Framer", image: "Certificate4", width: 230, height: 150)
]