标签: ios swift firebase firebase-realtime-database
rootRef.observe(.value, with: { (snap) in numberOfRows = Int(snap.childrenCount) print(numberOfRows) })
此函数在viewDidLoad()内,print语句打印5(数据库中的值),但如果我在此方法之外打印它打印0,我该如何解决?
viewDidLoad()
print