title: Initializer for conditional binding must have Optional type, not 'Dealership'
body: <p>I keep getting:</p>
  
  <blockquote>
    <p>Initializer for conditional binding must have Optional type, not 'Dealership'</p>
  </blockquote>
  
  <p>What would I do to resolve this issue occurring in my code? My Xcode version is 10.1.</p>
  
  <pre><code>import UIKit
  import FirebaseCore
  import FirebaseFirestore
  import SDWebImage
  
  class TableViewController: UITableViewController {
  
      private var documents: [DocumentSnapshot] = []
      public var dealerships: [Dealership] = []
      private var listener : ListenerRegistration!
      var selectedDealership: Dealership? = nil
  
      fileprivate func baseQuery() -&gt; Query {
          return Firestore.firestore().collection("dealerships").limit(to: 50)
      }
  
      fileprivate var query: Query? {
          didSet {
              if let listener = listener {
                  listener.remove()
              }
          }
      }
  
      override func viewDidAppear(_ animated: Bool) {
          self.dealerships = []
  
          self.listener =  query?.addSnapshotListener { (documents, error) in
              guard let snapshot = documents else {
                  print("Error fetching documents results: \(error!)")
                  return
              }
  
              for snap in snapshot.documents {
                  // Error on the following line
                  if let dealership = Dealership(name: snap.data()["name"] as! String, location: snap.data()["location"] as! String, opening_times: snap.data()["opening_times"] as! String, image_url: snap.data()["image_url"] as! String, maps_link: snap.data()["maps_link"] as! String, phone: snap.data()["phone"] as! String, id: snap.data()["name"] as! String){
                      self.dealerships.append(dealership)
                  }
              }
  
              //self.dealerships = results
              self.documents = snapshot.documents
              self.tableView.reloadData()
  
          }
      }
  </code></pre>