Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for child in snapshot.children {
- let bus = Bus()
- let snap = child as! DataSnapshot
- let key = snap.key
- if let coming = snap.childSnapshot(forPath: "coming").value as? Bool {
- bus.coming = coming
- }
- if let gone = snap.childSnapshot(forPath: "gone").value as? Bool {
- bus.gone = gone
- }
- if let here = snap.childSnapshot(forPath: "here").value as? Bool {
- bus.here = here
- }
- if let location = snap.childSnapshot(forPath: "location").value as? String {
- bus.location = location
- }
- if let notes = snap.childSnapshot(forPath: "notes").value as? String {
- bus.notes = notes
- }
- busArray.append(bus)
- class Bus: NSObject {
- var here: Bool
- var gone: Bool
- var coming: Bool
- var location: String
- var notes: String?
- override init() {
- self.here = false
- self.gone = false
- self.coming = true
- self.location = ""
- self.notes = ""
- }
Add Comment
Please, Sign In to add comment