This file contains hidden or 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 hidden or 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 Firebase | |
| class AuthenticationService: ObservableObject { | |
| @Published var user: User? | |
| var cancellable: AuthStateDidChangeListenerHandle? | |
| init() { | |
| cancellable = Auth.auth().addStateDidChangeListener { (_, user) in | |
| if let user = user { | |
| logger.event("Got user: \(user.uid)") |
This file contains hidden or 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
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
| // Override point for customization after application launch. | |
| FirebaseApp.configure() | |
| return true | |
| } |
This file contains hidden or 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 LoginView: View { | |
| @State var email: String = "" | |
| @State var password: String = "" | |
| var body: some View { | |
| NavigationView { | |
| VStack { | |
| ... | |
| NavigationLink(destination: CreateAccountView()) { |
This file contains hidden or 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 = "" | |
| var body: some View { | |
| VStack { | |
| Text("Create an account") | |
| .font(.title) | |
| TextField("Email", text: $email) | |
| .autocapitalization(.none) |
This file contains hidden or 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 | |
| struct LoginView: View { | |
| @State var email: String = "" | |
| @State var password: String = "" | |
| var body: some View { | |
| VStack { | |
| Text("Login") | |
| .font(.title) |
This file contains hidden or 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
| // MIR for `test` | |
| // source = MirSource { def_id: DefId(0/0:3 ~ borrowck_use_in_index_lvalue[317d]::test[0]), promoted: None } | |
| // pass_name = nll | |
| // disambiguator = 0 | |
| | Free Region Mapping | |
| | '_#0r | Global | ['_#0r, '_#1r] | |
| | '_#1r | Local | ['_#1r] | |
| | | |
| | Inferred Region Values |
This file contains hidden or 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
| DEBUG 2018-03-23T18:14:46Z: rustc_mir::borrow_check::nll::type_check: run_pass: DefId(0/0:3 ~ borrowck_move_out_from_array[317d]::move_out_from_begin_and_end[0]) | |
| DEBUG 2018-03-23T18:14:46Z: rustc_mir::borrow_check::nll::type_check: run_pass: DefId(0/0:4 ~ borrowck_move_out_from_array[317d]::move_out_by_const_index_and_subslice[0]) | |
| DEBUG 2018-03-23T18:14:46Z: rustc_mir::borrow_check::nll::type_check: run_pass: DefId(0/0:5 ~ borrowck_move_out_from_array[317d]::main[0]) | |
| DEBUG 2018-03-23T18:14:46Z: rustc_mir::borrow_check: run query mir_borrowck: move_out_from_begin_and_end | |
| DEBUG 2018-03-23T18:14:46Z: rustc_mir::borrow_check::nll: replace_regions_in_mir(def_id=DefId(0/0:3 ~ borrowck_move_out_from_array[317d]::move_out_from_begin_and_end[0])) | |
| DEBUG 2018-03-23T18:14:46Z: rustc_mir::borrow_check::nll::universal_regions: build(mir_def_id=DefId(0/0:3 ~ borrowck_move_out_from_array[317d]::move_out_from_begin_and_end[0])) | |
| DEBUG 2018-03-23T18:14:46Z: rustc_mir::borrow_check::nll::universal_regions: build: param_env=Param |
This file contains hidden or 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
| // MIR for `move_out_from_begin_and_end` | |
| // source = MirSource { def_id: DefId(0/0:3 ~ borrowck_move_out_from_array[317d]::move_out_from_begin_and_end[0]), promoted: None } | |
| // pass_name = nll | |
| // disambiguator = 0 | |
| | Free Region Mapping | |
| | '_#0r | Global | ['_#0r, '_#1r] | |
| | '_#1r | Local | ['_#1r] | |
| | | |
| | Inferred Region Values |
This file contains hidden or 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
| // MIR for `test` | |
| // source = MirSource { def_id: DefId(0/0:3 ~ borrowck_use_in_index_lvalue[317d]::test[0]), promoted: None } | |
| // pass_name = nll | |
| // disambiguator = 0 | |
| | Free Region Mapping | |
| | '_#0r | Global | ['_#0r, '_#1r] | |
| | '_#1r | Local | ['_#1r] | |
| | | |
| | Inferred Region Values |