Ferrite-backup/Ferrite/Views/CommonViews/HybridSecureField.swift
kingbri b8799be896 Ferrite: Add Kodi support
Adds support for playing links on a preset Kodi server. This is
less featured than the Ferrite companion, but should still work
without a problem.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-05 14:11:52 -05:00

34 lines
810 B
Swift

//
// HybridSecureField.swift
// Ferrite
//
// Created by Brian Dashore on 3/4/23.
//
import SwiftUI
struct HybridSecureField: View {
@Binding var text: String
@State private var showPassword = false
var body: some View {
HStack {
Group {
if showPassword {
TextField("Password", text: $text)
} else {
SecureField("Password", text: $text)
}
}
.autocorrectionDisabled(true)
.autocapitalization(.none)
Button {
showPassword.toggle()
} label: {
Image(systemName: self.showPassword ? "eye.slash.fill" : "eye.fill")
.foregroundColor(.secondary)
}
}
}
}