Add copy and clear buttons

This commit is contained in:
Ira Limitanei 2024-07-04 12:00:16 +09:00
parent 8011ceeaf3
commit 498610a0ef
No known key found for this signature in database
GPG Key ID: 3B416C2117091FF3

View File

@ -82,6 +82,18 @@ struct PasswordCheckerDemo: View {
FormSection("") {
Form {
EntryRow("Password", text: $password)
.suffix {
Button(icon: .default(icon: .editCopy)) {
State<Any>.copy(password)
}
.flat()
.verticalCenter()
Button(icon: .default(icon: .editClear)) {
password = ""
}
.flat()
.verticalCenter()
}
}
}
.padding()