import SwiftUI
struct ContentView : View {
var body: some View {
PasswordGeneratorSettings(settingsConfiguration: PasswordGeneratorSettings.Settings.init(passwordLength: 20))
}
}
struct PasswordGeneratorSettings : View {
@State var settingsConfiguration: Settings
struct Settings {
var passwordLength = UInt()
}
var body: some View {
NavigationView {
List {
Slider(value: $settingsConfiguration.passwordLength) { pressed in
Text("Password Length: \(settingsConfiguration.passwordLength)")
}
}.navigationBarTitle(Text("Settings"))
}
}
}
So I'm making a password generator and I want to start off with a slider with a minimum length of 1 and a maximum length of 512 with a label displaying it's value (As an integer) but this is all I got to just try having an updating label on the left of the tableview (List) with the slider on the right but this doesn't even compile.
Too Long Didn't Read: I'm trying to:
Figure out how to set a minimum and maximum value with a Slider
Have a label with the Slider's value (as an integer) on the left side of a tableview cell with the slider on the right side.
And I want to do all of this without UIKit just SwiftUI (and Combine if needed).