-
Notifications
You must be signed in to change notification settings - Fork 407
Closed
Labels
awaiting-replyThis issue needs more information.This issue needs more information.
Description
I created this ViewModifier but when initially shown the text is not presented as isSecureTextEntry == true even though isSecure is true. Any idea why?! thanks! 😄
struct SecureToggle: ViewModifier {
@State public var isSecure: Bool = true
public func body(content: Content) -> some View {
HStack {
content
.introspectTextField { (textfield) in
textfield.isSecureTextEntry = isSecure
}
Spacer()
Button(action: {
self.isSecure.toggle()
}) {
Image(systemName: isSecure ? "eye.slash":"eye")
.foregroundColor(Color.Nikola.lightBlue)
}
.padding()
}
}
}jshanson7
Metadata
Metadata
Assignees
Labels
awaiting-replyThis issue needs more information.This issue needs more information.