我对swift和Firebase相当陌生。我有这样的数据库:Swift 3中的Firebase数据库设置和数据处理
在应用程序中我有多个注释,我需要将信息从数据库传递给他们。在这一点上,我对将数据作为字典读取并传递给注释感到困惑。 这是我以前的代码时,我没有使用数据库,使用数组:
for i in 0...2
{
let coordinate = coordinates[i]
let point = myAnnotation(coordinate: CLLocationCoordinate2D(latitude: coordinate[0] , longitude: coordinate[1]))
point.name = names[i]
point.address = addresses[i]
point.hours = hours[i]
point.phones = phones[i]
self.mapView.addAnnotation(point)
}
你不必为我的代码,但我至少需要一些提示吧。
显示您正在尝试的Firebase基本代码。 –