title: Creating Firestore document with text field data
body: <p>So im making a sign up page on xcode with firebase and it currently work well but I would like to get more information from the user such as the first name and the last name . Basically I want my code to automatically create a document named with the email of the user that just sign up in the "Users" collection on firestore and after create the field "FirstName" and "LastName" with the text in those textfield! You can see my code below . Thanks for your help in advance. And I also provide a screenshot ( I did it manually to explain what I want it to do )</p>
  
  <pre><code>@IBOutlet weak var FirstName: UITextField!
  @IBOutlet weak var LastName: UITextField!
  @IBOutlet weak var Email: UITextField!
  @IBOutlet weak var Password: UITextField!
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      // Do any additional setup after loading the view.
  }
  
  @IBAction func SignUpButton(_ sender: Any) {
      if Email.text?.isEmpty == true {
          print("No text in email field")
          return
      }
      if Password.text?.isEmpty == true {
          print("No text in password field")
          return
      }
      if FirstName.text?.isEmpty == true {
          print("No text in first name field")
          return
      }
      if LastName.text?.isEmpty == true {
          print("No text in Last name field")
          return
  
      }
      SignUp()
  }
  
  @IBAction func LoginButton(_ sender: Any) {
  let storyboard = UIStoryboard(name: "Main", bundle: nil)
      let vc = storyboard.instantiateViewController(identifier: "SignInPage")
      vc.modalPresentationStyle = .overFullScreen
      present(vc, animated: true)
  }
  
  func SignUp() {
  
      Auth.auth().createUser(withEmail: Email.text!, password: Password.text!) { (authResult, error) in
          guard let user = authResult?.user, error == nil else {
              print("Error \(error!.localizedDescription)")
          return
          }
  
          let storyboard = UIStoryboard(name: "Main", bundle: nil)
          let vc = storyboard.instantiateViewController(identifier: "Manager0")
             vc.modalPresentationStyle = .overFullScreen
          self.present(vc, animated: true)
  
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/8X2bb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8X2bb.png" alt="enter image description here"></a></p>