struct GroupBoxLabelView: View { var labelText: String var labelImage: String var body: some View { HStack { Text(labelText.uppercased()).fontWeight(.bold) Spacer() Image(systemName: labelImage) } } } struct GroupBoxLabelView_Previews: PreviewProvider { static var previews: some View { GroupBoxLabelView(labelText: "App Details", labelImage: "info.circle") .previewLayout(.sizeThatFits) .padding() } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter