Can any one help me to detect internet connection with Firebase Database using Swift 3? I am using this function to download data from database.
func loadData(){
Ref=FIRDatabase.database().reference()
Handle = Ref?.child("Posts").queryOrdered(byChild: "Des").queryEqual(toValue: "11").observe(.childAdded ,with: { (snapshot) in
if let post = snapshot.value as? [String : AnyObject] {
let img = Posts()
img.setValuesForKeys(post)
self.myarray.append(img)
self.tableView.reloadData()
}else {
}
})
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…