mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-04-19 23:31:28 +02:00
32 lines
689 B
Swift
Executable File
32 lines
689 B
Swift
Executable File
/*
|
||
See LICENSE folder for this sample’s licensing information.
|
||
|
||
Abstract:
|
||
A view that shows a badge for hiking.
|
||
*/
|
||
|
||
import SwiftUI
|
||
|
||
struct HikeBadge: View {
|
||
var name: String
|
||
var body: some View {
|
||
VStack(alignment: .center) {
|
||
Badge()
|
||
.frame(width: 300, height: 300)
|
||
.scaleEffect(1.0 / 3.0)
|
||
.frame(width: 100, height: 100)
|
||
Text(name)
|
||
.font(.caption)
|
||
.accessibility(label: Text("Badge for \(name)."))
|
||
}
|
||
}
|
||
}
|
||
|
||
#if DEBUG
|
||
struct HikeBadge_Previews: PreviewProvider {
|
||
static var previews: some View {
|
||
HikeBadge(name: "Preview Testing")
|
||
}
|
||
}
|
||
#endif
|