Mercurial > public > simoleon
comparison Simoleon/UI/Flag.swift @ 156:84137052813d
Refactor code
author | Dennis Concepcion Martin <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sat, 28 Aug 2021 11:15:25 +0100 |
parents | |
children | 0c589138a6f3 |
comparison
equal
deleted
inserted
replaced
155:681f2cbe8c7f | 156:84137052813d |
---|---|
1 // | |
2 // Flag.swift | |
3 // Simoleon | |
4 // | |
5 // Created by Dennis Concepción Martín on 24/8/21. | |
6 // | |
7 | |
8 import SwiftUI | |
9 | |
10 struct Flag: View { | |
11 var flag: String | |
12 | |
13 var body: some View { | |
14 Image(flag) | |
15 .resizable() | |
16 .aspectRatio(contentMode: .fill) | |
17 .frame(width: 30, height: 30) | |
18 .clipShape(Circle()) | |
19 .overlay(Circle().stroke(Color(.secondaryLabel), lineWidth: 1)) | |
20 } | |
21 } | |
22 | |
23 struct Flag_Previews: PreviewProvider { | |
24 static var previews: some View { | |
25 Flag(flag: "GB") | |
26 } | |
27 } |