This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct User { | |
var uid: String | |
var email: String? | |
var displayName: String? | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Resolver | |
extension Resolver: ResolverRegistering { | |
public static func registerAllServices() { | |
register { AuthenticationService() }.scope(application) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import Resolver | |
struct ContentView: View { | |
@ObservedObject var authenticationService: AuthenticationService = Resolver.resolve() | |
var body: some View { | |
Group { | |
if (authenticationService.user == nil) { | |
LoginView() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pod 'Firebase/Analytics' | |
pod 'FirebaseCore' | |
pod 'Firebase/Auth' | |
pod 'Firebase/Firestore' | |
pod 'Firebase/Crashlytics' | |
pod "FirebaseFirestoreSwift" | |
pod 'GRDB.swift' | |
pod 'Resolver' | |
post_install do |installer| | |
installer.pods_project.targets.select { |target| target.name == "GRDB.swift" }.each do |target| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct CreateAccountView: View { | |
@State var email: String = "" | |
@State var password: String = "" | |
@Injected var authenticationService: AuthenticationService | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
action: { | |
self.authenticationService.signUp(email: self.email, password: self.password, handler: {_,_ in }) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injected var authenticationService: AuthenticationService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
action: { | |
self.authenticationService.signIn(email: self.email, password: self.password, handler: {_,_ in }) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
handler: {res,err in | |
print(res) | |
print(err) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import FirebaseFirestore | |
import FirebaseFirestoreSwift | |
import Foundation | |
import GRDB | |
struct Note: Codable, Identifiable { | |
var id: String = UUID().uuidString | |
var title: String | |
var createdTime = Timestamp() | |
var content: String |