Preview:
//Para escribir datos en la base de datos, podemos utilizar el siguiente código:
let data: [String: Any] = [
  "name": "Santo Domingo",
  "population": 13929286
]
db.collection("cities").document("San Dom").setData(data) { error in
  if let error = error {
    print("Error al escribir datos: \(error.localizedDescription)")
    return
  }
  print("Datos escritos con éxito")
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter