Created
April 8, 2018 16:34
-
-
Save 3257/e8080459d951a1be7c8080be95f94f85 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
ref.child("unicorns").observe(.value) { snapshot in | |
var unicorns = [Unicorn]() | |
for unicornSnapshot in snapshot.children { | |
let unicorn = Unicorn(snapshot: unicornSnapshot as! DataSnapshot) | |
unicorns.append(unicorn) | |
} | |
self.unicorns = unicorns | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment