Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created June 12, 2023 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sturdysturge/7fb96bc447f3a59e7cea684f2461365f to your computer and use it in GitHub Desktop.
Save sturdysturge/7fb96bc447f3a59e7cea684f2461365f to your computer and use it in GitHub Desktop.
import SwiftUI
struct ContentView: View {
@State var model = ViewModel.shared
var body: some View {
VStack {
Slider(value:
$model.width, in: 1...200)
Rectangle()
.frame(maxWidth: model.width, maxHeight: .infinity)
.foregroundColor(.red)
}
}
}
#Preview { ContentView() }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment