peterfriese / MakeItSo

This is the source code for Make It So, the sample app accompanying my blog post "Replicating the iOS Reminders App Using SwiftUI and Firebase"

Home Page:https://twitter.com/peterfriese/status/1453467058302291975

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Part 3] Small copy error

goliatone opened this issue · comments

Looking at one of the snippets in the 3rd blog post:

class AuthenticationService: ObservableObject {
  // ...
  func updateDisplayName(displayName: String) { // (2)
    if let user = Auth.auth().currentUser {
      let changeRequest = user.createProfileChangeRequest() // (3)
      changeRequest.displayName = displayName
      changeRequest.commitChanges { error in // (4)
        if error != nil {
          print("Successfully updated display name for user [\(user.uid)] to [\(displayName)]")
        }
      }
    }
  }
}

I think this is a typo? Should be error == nil:

if error != nil {
          print("Successfully updated display name for user [\(user.uid)] to [\(displayName)]")