title: Data from iOS app not saving to Firebase Database
body: <p>I'm looking to save data that has been stored in 4 labels and 1 text view in my app onto my Firebase Database but I am not having any success, below is the code I have written.  The app is a form that gets filled in and has a save button that once pressed should send the data to my firebase database but when I check there is nothing there?</p>
  
  <p>I'm not even sure how I would check for errors in the console for this problem.</p>
  
  <pre><code>import UIKit
  import CoreLocation
  import Firebase
  
  class AddSightingViewController: UIViewController {
  
      @IBOutlet weak var dateLabel: UILabel!
      @IBOutlet weak var timeLabel: UILabel!
      @IBOutlet weak var latitudeLabel: UILabel!
      @IBOutlet weak var longitudeLabel: UILabel!
      @IBOutlet weak var descriptionLabel: UITextView!
  
      var locManager = CLLocationManager()
      var currentLocation: CLLocation!
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          // Set Date &amp; Time
  
          let dateFormatter = DateFormatter()
          dateFormatter.dateStyle = .medium
  
          dateFormatter.setLocalizedDateFormatFromTemplate("EEEE, MMM d, yyyy") // // set template after setting locale
  
          let dateString = "\(dateFormatter.string(from: Date() as Date))"
          dateLabel.text = String(dateString)
  
          let timeFormatter = DateFormatter()
          timeFormatter.timeStyle = .medium
  
          timeFormatter.setLocalizedDateFormatFromTemplate("hhmm")
  
          let timeString = "\(timeFormatter.string(from: Date() as Date))"
  
          timeLabel.text = String(timeString)
  
          // Set Latitude &amp; Longitude
  
          locManager.requestWhenInUseAuthorization()
  
          if (CLLocationManager.authorizationStatus() == CLAuthorizationStatus.authorizedWhenInUse ||
              CLLocationManager.authorizationStatus() == CLAuthorizationStatus.authorizedAlways){
              currentLocation = locManager.location
              self.latitudeLabel.text = String("\(currentLocation.coordinate.latitude)")
              self.longitudeLabel.text = String("\(currentLocation.coordinate.longitude)")
          }
      }
  
      func post() {
  
          let date = dateLabel.text
          let time = timeLabel.text
          let latitude = latitudeLabel.text
          let longitude = longitudeLabel.text
          let sightingDescription = descriptionLabel.text
  
          let post: [String : AnyObject] = ["date" : date as AnyObject,
                                            "time" : time as AnyObject,
                                            "latitude" : latitude as AnyObject,
                                            "longitude" : longitude as AnyObject,
                                            "Description" : sightingDescription as AnyObject]
  
          var ref: DatabaseReference!
  
          ref = Database.database().reference()
  
  
          ref.child("Sightings").childByAutoId().setValue(post)
  
      }
  
      @IBAction func saveButton(_ sender: Any) {
  
          post()
  
      }
  }
  </code></pre>