From b95697bf0dfa8b15cabb61d4c513a131a7c08248 Mon Sep 17 00:00:00 2001 From: Rizwan Mohamed Ibrahim Date: Mon, 13 Jul 2020 20:52:05 +0530 Subject: [PATCH] Add show/hide password for feedbin account view --- .../Accounts/SettingsFeedbinAccountModel.swift | 1 + .../Accounts/SettingsFeedbinAccountView.swift | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Multiplatform/iOS/Settings/Accounts/SettingsFeedbinAccountModel.swift b/Multiplatform/iOS/Settings/Accounts/SettingsFeedbinAccountModel.swift index 0ce461b9c..c3e4091c2 100644 --- a/Multiplatform/iOS/Settings/Accounts/SettingsFeedbinAccountModel.swift +++ b/Multiplatform/iOS/Settings/Accounts/SettingsFeedbinAccountModel.swift @@ -41,6 +41,7 @@ class SettingsFeedbinAccountModel: ObservableObject { } } @Published var showError: Bool = false + @Published var showPassword: Bool = false init() { diff --git a/Multiplatform/iOS/Settings/Accounts/SettingsFeedbinAccountView.swift b/Multiplatform/iOS/Settings/Accounts/SettingsFeedbinAccountView.swift index 884e26eed..27bd58b3d 100644 --- a/Multiplatform/iOS/Settings/Accounts/SettingsFeedbinAccountView.swift +++ b/Multiplatform/iOS/Settings/Accounts/SettingsFeedbinAccountView.swift @@ -30,7 +30,19 @@ struct SettingsFeedbinAccountView: View { List { Section(header: AccountHeaderImageView(image: AppAssets.image(for: .feedbin)!)) { TextField("Email", text: $settingsModel.email).textContentType(.emailAddress) - SecureField("Password", text: $settingsModel.password) + HStack { + if settingsModel.showPassword { + TextField("Password", text:$settingsModel.password) + } + else { + SecureField("Password", text: $settingsModel.password) + } + Button(action: { + settingsModel.showPassword.toggle() + }) { + Text(settingsModel.showPassword ? "Hide" : "Show") + } + } } Section(footer: errorFooter) { HStack {