Skip to content

Commit 326993c

Browse files
authored
[Auth] Convert LoginView to SwiftUI (#13628)
1 parent b372ee7 commit 326993c

File tree

9 files changed

+208
-444
lines changed

9 files changed

+208
-444
lines changed

FirebaseAuth/Tests/SampleSwift/AuthenticationExample.xcodeproj/project.pbxproj

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
EA20B50C249E8F0700B5E581 /* AuthMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA20B50B249E8F0700B5E581 /* AuthMenu.swift */; };
4747
EA20B510249FDB4400B5E581 /* OtherAuthMethods.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA20B50F249FDB4400B5E581 /* OtherAuthMethods.swift */; };
4848
EA217895248979E200736757 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EA217894248979E200736757 /* LaunchScreen.storyboard */; };
49+
EA3348322C90EFF40091D7C2 /* LoginViewSwiftUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA3348312C90EFE40091D7C2 /* LoginViewSwiftUI.swift */; };
4950
EA527CAA24A0766D00ADB9A2 /* OtherAuthViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA527CA924A0766D00ADB9A2 /* OtherAuthViewController.swift */; };
5051
EA527CAC24A0EE9600ADB9A2 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA527CAB24A0EE9600ADB9A2 /* LoginView.swift */; };
5152
EAB3A1792494433500385291 /* DataSourceProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAB3A1782494433500385291 /* DataSourceProvider.swift */; };
@@ -57,7 +58,6 @@
5758
EAE4CBC924855E3A00245E92 /* AuthViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAE4CBC824855E3A00245E92 /* AuthViewController.swift */; };
5859
EAE4CBCE24855E3D00245E92 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EAE4CBCD24855E3D00245E92 /* Assets.xcassets */; };
5960
EAE4CBE724855E3E00245E92 /* AuthenticationExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAE4CBE624855E3E00245E92 /* AuthenticationExampleUITests.swift */; };
60-
EAE4CBF524857A5100245E92 /* LoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAE4CBF424857A5100245E92 /* LoginController.swift */; };
6161
EAEBCE0F2489FFDE00FCEA92 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEBCE0E2489FFDE00FCEA92 /* Extensions.swift */; };
6262
EAEBCE11248A9AA000FCEA92 /* Section.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEBCE10248A9AA000FCEA92 /* Section.swift */; };
6363
EAFDF2BE2490439F0082B6F1 /* Animator.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAFDF2BD2490439F0082B6F1 /* Animator.swift */; };
@@ -125,8 +125,8 @@
125125
EA20B50B249E8F0700B5E581 /* AuthMenu.swift */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = AuthMenu.swift; sourceTree = "<group>"; };
126126
EA20B50F249FDB4400B5E581 /* OtherAuthMethods.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OtherAuthMethods.swift; sourceTree = "<group>"; };
127127
EA217894248979E200736757 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
128+
EA3348312C90EFE40091D7C2 /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = "<group>"; };
128129
EA527CA924A0766D00ADB9A2 /* OtherAuthViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OtherAuthViewController.swift; sourceTree = "<group>"; };
129-
EA527CAB24A0EE9600ADB9A2 /* LoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginView.swift; sourceTree = "<group>"; };
130130
EAB3A1782494433500385291 /* DataSourceProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataSourceProvider.swift; sourceTree = "<group>"; };
131131
EAB3A17B2494628200385291 /* UserViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserViewController.swift; sourceTree = "<group>"; };
132132
EAD8BD3F2CE535C400E23E30 /* MFALoginView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MFALoginView.swift; sourceTree = "<group>"; };
@@ -140,7 +140,6 @@
140140
EAE4CBE224855E3E00245E92 /* AuthenticationExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AuthenticationExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
141141
EAE4CBE624855E3E00245E92 /* AuthenticationExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationExampleUITests.swift; sourceTree = "<group>"; };
142142
EAE4CBE824855E3E00245E92 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
143-
EAE4CBF424857A5100245E92 /* LoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginController.swift; sourceTree = "<group>"; };
144143
EAEBCE0E2489FFDE00FCEA92 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
145144
EAEBCE10248A9AA000FCEA92 /* Section.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Section.swift; sourceTree = "<group>"; };
146145
EAFDF2BD2490439F0082B6F1 /* Animator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animator.swift; sourceTree = "<group>"; };
@@ -224,7 +223,6 @@
224223
children = (
225224
EAE08EB424CF5D09006FA3A5 /* AccountLinkingViewController.swift */,
226225
EAE4CBC824855E3A00245E92 /* AuthViewController.swift */,
227-
EAE4CBF424857A5100245E92 /* LoginController.swift */,
228226
EAB3A17B2494628200385291 /* UserViewController.swift */,
229227
EA02F68E24A0714B0079D000 /* OtherAuthMethodControllers */,
230228
DEC2E5DC2A95331D0090260A /* SettingsViewController.swift */,
@@ -248,7 +246,7 @@
248246
children = (
249247
EAD8BD3F2CE535C400E23E30 /* MFALoginView.swift */,
250248
EA20B46B2495A9F900B5E581 /* SignedOutView.swift */,
251-
EA527CAB24A0EE9600ADB9A2 /* LoginView.swift */,
249+
EA3348312C90EFE40091D7C2 /* LoginView.swift */,
252250
);
253251
path = CustomViews;
254252
sourceTree = "<group>";
@@ -550,6 +548,7 @@
550548
buildActionMask = 2147483647;
551549
files = (
552550
EA20B46E2495B2C700B5E581 /* DataSourceProtocols.swift in Sources */,
551+
EA3348322C90EFF40091D7C2 /* LoginView.swift in Sources */,
553552
EAB3A1792494433500385291 /* DataSourceProvider.swift in Sources */,
554553
EA20B46C2495A9F900B5E581 /* SignedOutView.swift in Sources */,
555554
EA527CAA24A0766D00ADB9A2 /* OtherAuthViewController.swift in Sources */,
@@ -560,7 +559,6 @@
560559
EA02F68524A000E00079D000 /* UserActions.swift in Sources */,
561560
EA02F68D24A063E90079D000 /* LoginDelegate.swift in Sources */,
562561
EA20B50A249D3D8600B5E581 /* PasswordlessViewController.swift in Sources */,
563-
EAE4CBF524857A5100245E92 /* LoginController.swift in Sources */,
564562
EA20B510249FDB4400B5E581 /* OtherAuthMethods.swift in Sources */,
565563
EA12697F29E33A5D00D79E66 /* CryptoUtils.swift in Sources */,
566564
EAEBCE11248A9AA000FCEA92 /* Section.swift in Sources */,
@@ -572,7 +570,6 @@
572570
EAFDF2BE2490439F0082B6F1 /* Animator.swift in Sources */,
573571
EAE4CBC724855E3A00245E92 /* SceneDelegate.swift in Sources */,
574572
EAE08EB524CF5D09006FA3A5 /* AccountLinkingViewController.swift in Sources */,
575-
EA527CAC24A0EE9600ADB9A2 /* LoginView.swift in Sources */,
576573
EAEBCE0F2489FFDE00FCEA92 /* Extensions.swift in Sources */,
577574
);
578575
runOnlyForDeploymentPostprocessing = 0;
@@ -717,7 +714,7 @@
717714
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
718715
GCC_WARN_UNUSED_FUNCTION = YES;
719716
GCC_WARN_UNUSED_VARIABLE = YES;
720-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
717+
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
721718
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
722719
MTL_FAST_MATH = YES;
723720
ONLY_ACTIVE_ARCH = YES;
@@ -772,7 +769,7 @@
772769
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
773770
GCC_WARN_UNUSED_FUNCTION = YES;
774771
GCC_WARN_UNUSED_VARIABLE = YES;
775-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
772+
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
776773
MTL_ENABLE_DEBUG_INFO = NO;
777774
MTL_FAST_MATH = YES;
778775
OTHER_LDFLAGS = "-ObjC";
@@ -815,6 +812,7 @@
815812
"CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Developer";
816813
CODE_SIGN_STYLE = Manual;
817814
DEVELOPMENT_TEAM = "";
815+
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = EQHXZ8M8AV;
818816
INFOPLIST_FILE = AuthenticationExample/SwiftApplication.plist;
819817
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
820818
LD_RUNPATH_SEARCH_PATHS = (
@@ -839,7 +837,7 @@
839837
CODE_SIGN_STYLE = Automatic;
840838
DEVELOPMENT_TEAM = "";
841839
INFOPLIST_FILE = SwiftApiTests/Info.plist;
842-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
840+
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
843841
LD_RUNPATH_SEARCH_PATHS = (
844842
"$(inherited)",
845843
"@executable_path/Frameworks",
@@ -864,7 +862,7 @@
864862
CODE_SIGN_STYLE = Automatic;
865863
DEVELOPMENT_TEAM = "";
866864
INFOPLIST_FILE = SwiftApiTests/Info.plist;
867-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
865+
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
868866
LD_RUNPATH_SEARCH_PATHS = (
869867
"$(inherited)",
870868
"@executable_path/Frameworks",

FirebaseAuth/Tests/SampleSwift/AuthenticationExample/AppDelegate.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
7171
private func configureApplicationAppearance() {
7272
UINavigationBar.appearance().tintColor = .systemOrange
7373
UITabBar.appearance().tintColor = .systemOrange
74+
// Handles iOS 15 behavior change where tab bar become translucent during transitions.
75+
let appearance = UITabBarAppearance()
76+
appearance.configureWithOpaqueBackground()
77+
UITabBar.appearance().scrollEdgeAppearance = appearance
7478
}
7579
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"info" : {
3-
"version" : 1,
4-
"author" : "xcode"
3+
"author" : "xcode",
4+
"version" : 1
55
}
6-
}
6+
}

FirebaseAuth/Tests/SampleSwift/AuthenticationExample/Assets.xcassets/firebaseLogo.imageset/Contents.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)