-
-
Save sturdysturge/4a0427f92c95b791429f1f5df9c447b8 to your computer and use it in GitHub Desktop.
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 ContentView: View { | |
@State var width = CGFloat(100) | |
@State var height = CGFloat(100) | |
var body: some View { | |
VStack { | |
Spacer() | |
Group { | |
HStack { | |
Text("Width") | |
Slider(value: $width, in: 100...1000) | |
Text(String(format: "%.2f", width)) | |
} | |
HStack { | |
Text("Height") | |
Slider(value: $height, in: 100...1000) | |
Text(String(format: "%.2f", height)) | |
} | |
} | |
.padding() | |
.background(Color.white) | |
} | |
.background( | |
ScaledPaddingView() | |
.frame(width: width, height: height) | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment