File size: 906 Bytes
17afd55
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import SwiftUI

struct ContactView: View {
    @State var contact: Contact
    
    var body: some View {
        VStack {
            Text(contact.displayName).padding()
                .bold()
                .foregroundColor(.white)
                .font(.system(size: 18))
                .padding()
            List {
                ForEach(contact.phoneNumbers, id: \.self) { phone in
                    Text(phone)
                        .foregroundColor(.white)
                        .font(.system(size: 15))
                        .padding()
                }
            }.listStyle(PlainListStyle()).padding(.bottom, 10)
        }
    }
}

struct ContactView_Previews: PreviewProvider {
    static var previews: some View {
        ContactView(contact: Contact(
            contactId: "5",
            displayName: "Peter Luo",
            phoneNumbers: ["123-234-345"])
        )
    }
}