Created
July 7, 2020 16:01
-
-
Save DominatorVbN/9988d3ba94dc0377ff67f722f5268241 to your computer and use it in GitHub Desktop.
New group box view in SwiftUI
This file contains 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 GroupBoxs: View { | |
@State var progress: CGFloat = 0.3 | |
var body: some View { | |
VStack(spacing: 20) { | |
//Groupbox arranges view as an vstack so it's safe to assume that has an implicit VStack in defination | |
GroupBox(label: Text("Progress"), content: { | |
ProgressView(value: progress, total: 1.0) | |
Stepper("Progress stepper", value: $progress) | |
}) | |
//Group box can have label optionally | |
GroupBox { | |
Slider(value: $progress) | |
} | |
} | |
.padding(.all, 20) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment