Skip to content

Commit 706cc96

Browse files
authored
Merge pull request #265 from TaskarCenterAtUW/feature-2028-Add-Show/Hide-Password-Toggle-on-Login-Screen
implemented Add Show/Hide Password Toggle on Login Screen
2 parents 66e9449 + 079e615 commit 706cc96

File tree

3 files changed

+58
-4
lines changed

3 files changed

+58
-4
lines changed

GoInfoGame/GoInfoGame.xcodeproj/project.pbxproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@
180180
B0CCB98C2B8626AE00AA73DE /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0CCB98B2B8626AE00AA73DE /* ProfileView.swift */; };
181181
B0CCB98E2B8626C600AA73DE /* ProfileViewVM.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0CCB98D2B8626C600AA73DE /* ProfileViewVM.swift */; };
182182
C76DA1A12DF0679F00451E63 /* LongFormModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA8C74C32C4FDE1000D28220 /* LongFormModel.swift */; };
183+
C77A4A262DF2AF3100DED8B0 /* SecureInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77A4A252DF2AF3100DED8B0 /* SecureInputView.swift */; };
183184
C77EEBCF2DE59D3200494CB4 /* UndoMerge.swift in Sources */ = {isa = PBXBuildFile; fileRef = C77EEBCE2DE59D3200494CB4 /* UndoMerge.swift */; };
184185
C7ED070F2D70E2EC001FFFE2 /* TokenRefresher.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7ED070E2D70E2EC001FFFE2 /* TokenRefresher.swift */; };
185186
CFECB318461BB876B1621890 /* Pods_osmapi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C4F37DA661B22FA87DF8282F /* Pods_osmapi.framework */; };
@@ -505,6 +506,7 @@
505506
B0CCB98B2B8626AE00AA73DE /* ProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = "<group>"; };
506507
B0CCB98D2B8626C600AA73DE /* ProfileViewVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileViewVM.swift; sourceTree = "<group>"; };
507508
C4F37DA661B22FA87DF8282F /* Pods_osmapi.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_osmapi.framework; sourceTree = BUILT_PRODUCTS_DIR; };
509+
C77A4A252DF2AF3100DED8B0 /* SecureInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureInputView.swift; sourceTree = "<group>"; };
508510
C77EEBCE2DE59D3200494CB4 /* UndoMerge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UndoMerge.swift; sourceTree = "<group>"; };
509511
C7ED070E2D70E2EC001FFFE2 /* TokenRefresher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenRefresher.swift; sourceTree = "<group>"; };
510512
C96303080D26026265099E0E /* Pods-GoInfoGame.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GoInfoGame.release.xcconfig"; path = "Target Support Files/Pods-GoInfoGame/Pods-GoInfoGame.release.xcconfig"; sourceTree = "<group>"; };
@@ -1544,6 +1546,7 @@
15441546
FAFDA1FC2C6D322800ECEAE9 /* View */ = {
15451547
isa = PBXGroup;
15461548
children = (
1549+
C77A4A252DF2AF3100DED8B0 /* SecureInputView.swift */,
15471550
FA8C74D72C60E95100D28220 /* PosmLogin.swift */,
15481551
);
15491552
path = View;
@@ -2192,6 +2195,7 @@
21922195
97412A9B2BBBF3B400DF7983 /* KerbHeightForm.swift in Sources */,
21932196
973FC04A2B5A478C00878269 /* CrossMarkingForm.swift in Sources */,
21942197
FAE2584F2D39819300D2BB12 /* ManageQuestsView.swift in Sources */,
2198+
C77A4A262DF2AF3100DED8B0 /* SecureInputView.swift in Sources */,
21952199
973FC03F2B59418B00878269 /* WayLit.swift in Sources */,
21962200
FAE481A42DD5F97800149A48 /* PasswordAuthenticationViewModel.swift in Sources */,
21972201
971342772BBD415600174EBF /* InitialViewController.swift in Sources */,
@@ -2733,7 +2737,7 @@
27332737
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
27342738
CODE_SIGN_IDENTITY = "Apple Development";
27352739
CODE_SIGN_STYLE = Automatic;
2736-
CURRENT_PROJECT_VERSION = 4;
2740+
CURRENT_PROJECT_VERSION = 35;
27372741
DEVELOPMENT_TEAM = G8MQVE5WWW;
27382742
GENERATE_INFOPLIST_FILE = YES;
27392743
INFOPLIST_FILE = GoInfoGame/Info.plist;
@@ -2771,7 +2775,7 @@
27712775
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
27722776
CODE_SIGN_IDENTITY = "Apple Development";
27732777
CODE_SIGN_STYLE = Automatic;
2774-
CURRENT_PROJECT_VERSION = 4;
2778+
CURRENT_PROJECT_VERSION = 35;
27752779
DEVELOPMENT_TEAM = G8MQVE5WWW;
27762780
GENERATE_INFOPLIST_FILE = YES;
27772781
INFOPLIST_FILE = GoInfoGame/Info.plist;

GoInfoGame/GoInfoGame/Login/View/PosmLogin.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct PosmLoginView: View {
1717

1818
@State private var shouldShowAlert = false
1919

20-
@State private var selectedEnvironment: APIEnvironment = .staging
20+
@State private var selectedEnvironment: APIEnvironment = .production
2121
@State private var showAlert = false
2222

2323
var body: some View {
@@ -36,7 +36,7 @@ struct PosmLoginView: View {
3636
.padding(.horizontal, 40)
3737
.textInputAutocapitalization(.never)
3838

39-
SecureField("Password", text: $viewModel.password)
39+
SecureInputView("Password", text: $viewModel.password)
4040
.padding()
4141
.background(Color(.systemGray6))
4242
.cornerRadius(10)
@@ -76,6 +76,8 @@ struct PosmLoginView: View {
7676
}
7777
.padding(.top, 20)
7878

79+
appVersionText
80+
7981
if SessionManager.shared.canUseBiometricLogin(for: selectedEnvironment) {
8082
Button(action: {
8183
APIConfiguration.shared.environment = selectedEnvironment
@@ -137,6 +139,12 @@ struct PosmLoginView: View {
137139
Text("Your session has expired. Please login again")
138140
}
139141
}
142+
143+
var appVersionText: Text {
144+
let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "N/A"
145+
let build = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "N/A"
146+
return Text("Version \(version) (\(build))")
147+
}
140148
}
141149

142150
#Preview {
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//
2+
// SecureInputView.swift
3+
// GoInfoGame
4+
//
5+
// Created by Srikanth V on 06/06/25.
6+
//
7+
8+
import SwiftUI
9+
10+
struct SecureInputView: View {
11+
@Binding private var text: String
12+
@State private var isSecured: Bool = true
13+
private var placeholder: String
14+
15+
init(_ placeholder: String = "", text: Binding<String>) {
16+
self.placeholder = placeholder
17+
self._text = text
18+
}
19+
20+
var body: some View {
21+
ZStack(alignment: .trailing) {
22+
Group {
23+
if isSecured {
24+
SecureField(placeholder, text: $text)
25+
} else {
26+
TextField(placeholder, text: $text)
27+
}
28+
}.padding(.trailing, 32)
29+
30+
Button(action: {
31+
isSecured.toggle()
32+
}) {
33+
Image(systemName: self.isSecured ? "eye.slash" : "eye")
34+
.accentColor(.gray)
35+
}
36+
}
37+
}
38+
}
39+
40+
#Preview {
41+
SecureInputView("Password", text: .constant("password"))
42+
}

0 commit comments

Comments
 (0)