Created
December 15, 2019 11:57
-
-
Save talreja-priya/291dfd89330aa34a7478d82437490524 to your computer and use it in GitHub Desktop.
SwiftUI View for row in List
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct EmployeeRow: View { | |
var employee: Employee | |
var body: some View { | |
HStack { | |
CircleImage(imageName: employee.image,size: 50).padding() | |
Text(employee.preferredFullName) | |
.bold() | |
.font(.callout) | |
Spacer() | |
}.frame(height: 60) | |
} | |
} | |
struct EmployeeRow_Previews: PreviewProvider { | |
static var previews: some View { | |
EmployeeRow(employee: employeeData[0]) | |
.previewLayout(.fixed(width: 320, height: 60)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment