【发布时间】:2017-02-28 12:50:44
【问题描述】:
我对 swift 和 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 基本代码。
标签: swift dictionary firebase firebase-realtime-database