Skip to content

Commit 49dfae1

Browse files
committed
Remove unneeded extension and finish renaming
1 parent 44dad32 commit 49dfae1

File tree

3 files changed

+4
-28
lines changed

3 files changed

+4
-28
lines changed

FirebaseAuth/Tests/SampleSwift/AuthenticationExample/CustomViews/LoginView.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// TODO(ncooke3): Change name of this file.
16-
1715
import SwiftUI
1816

1917
import FirebaseAuth
2018

21-
struct LoginViewSwiftUI: View {
19+
struct LoginView: View {
2220
@Environment(\.dismiss) private var dismiss
2321
@State private var multiFactorResolver: MultiFactorResolver? = nil
2422
@State private var onetimePasscode = ""
@@ -158,7 +156,7 @@ private struct SymbolTextField: TextFieldStyle {
158156
configuration
159157
.padding([.vertical, .trailing])
160158
}
161-
.background(Color.color(uiColor: .secondarySystemBackground))
159+
.background(Color(uiColor: .secondarySystemBackground))
162160
.cornerRadius(14)
163161
.textInputAutocapitalization(.never)
164162
}
@@ -188,5 +186,5 @@ private struct LoginViewButton: View {
188186
}
189187

190188
#Preview {
191-
LoginViewSwiftUI()
189+
LoginView()
192190
}

FirebaseAuth/Tests/SampleSwift/AuthenticationExample/Utility/Extensions.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,6 @@ import FirebaseAuth
1616
import SwiftUI
1717
import UIKit
1818

19-
// MARK: - Compat. API for converting `UIColor` to `Color`
20-
21-
extension Color {
22-
static func color(uiColor: UIColor) -> Self {
23-
if #available(iOS 15.0, *) {
24-
return Self(uiColor: uiColor)
25-
} else {
26-
var r: CGFloat = 0
27-
var g: CGFloat = 0
28-
var b: CGFloat = 0
29-
var a: CGFloat = 0
30-
uiColor.getRed(&r, green: &g, blue: &b, alpha: &a)
31-
return Self(
32-
red: Double(r),
33-
green: Double(g),
34-
blue: Double(b),
35-
opacity: Double(a)
36-
)
37-
}
38-
}
39-
}
40-
4119
// MARK: - Extending a `Firebase User` to conform to `DataSourceProvidable`
4220

4321
extension User: DataSourceProvidable {

FirebaseAuth/Tests/SampleSwift/AuthenticationExample/ViewControllers/AuthViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ class AuthViewController: UIViewController, DataSourceProviderDelegate {
340340
}
341341

342342
private func performDemoEmailPasswordLoginFlow() {
343-
let loginView = LoginViewSwiftUI()
343+
let loginView = LoginView()
344344
let hostingController = UIHostingController(rootView: loginView)
345345
navigationController?.pushViewController(hostingController, animated: true)
346346
}

0 commit comments

Comments
 (0)