使用观察firebase DB的模糊不清

Keg*_* K. 4 firebase swift firebase-realtime-database swift3

我真的不能得到什么问题?
我正在尝试从firebase Settings节点加载一些设置数据.其他函数中其他节点的相同代码可以工作,但这个代码不明确.为什么?

var ref:FIRDatabaseReference!  //Global variable

     override func viewDidLoad() {
        super.viewDidLoad()


        self.mapView.delegate = self

            if CLLocationManager.locationServicesEnabled() {

                locationManager.delegate = self
                locationManager.desiredAccuracy = kCLLocationAccuracyBest
                locationManager.requestWhenInUseAuthorization()
                locationManager.startUpdatingLocation()

              //  monitorRegion()

            } else {

                // Alert to enable location services on iphone first
            }

            ref = FIRDatabase.database().reference(fromURL: "https://*******.firebaseio.com/")
            //The error is here
            ref.child("Settings").child("service_types").observe(.value) { (snapshot) in

            }


        // Do any additional setup after loading the view.
    }
Run Code Online (Sandbox Code Playgroud)

ron*_*ory 15

改变这个:

ref.child("Settings").child("service_types").observe(.value) { (snapshot) in

}
Run Code Online (Sandbox Code Playgroud)

对此:

ref.child("Settings").child("service_types").observe(.value, with: { snapshot in

})
Run Code Online (Sandbox Code Playgroud)

另请参阅firebase文档部分监听值事件