-
-
Save romyilano/aab8b3760fa9982775a4 to your computer and use it in GitHub Desktop.
Revisions
-
romyilano revised this gist
Mar 4, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,9 @@ import UIKit class MyViewController: UIViewController { // Store ref and handle as implicitly unwrapped optionals // explanation about this > because the initializer might not be called esp from the storyboard var ref: Firebase! var handle: UInt! override func viewDidLoad() { -
romyilano revised this gist
Mar 4, 2016 . No changes.There are no files selected for viewing
-
davideast revised this gist
Oct 11, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import UIKit class MyViewController: UIViewController { // Store ref and handle as implicitly unwrapped optionals var ref: Firebase! var handle: UInt! @@ -15,7 +15,7 @@ class MyViewController: UIViewController { override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) // Create listener and store handle handle = ref.observeEventType(.Value) { print($0) } } override func viewDidDisappear(animated: Bool) { -
davideast created this gist
Oct 10, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ import UIKit class MyViewController: UIViewController { // Store ref as an implicitly unwrapped optional var ref: Firebase! var handle: UInt! override func viewDidLoad() { super.viewDidLoad() // Initialize Reference ref = Firebase(url: "https://<YOUR-FIREBASE-APP>.firebaseio.com/") } override func viewWillAppear(animated: Bool) { super.viewWillAppear(animated) // Create listener and store handle handle = ref.observeEventType(FEventType.Value) { print($0) } } override func viewDidDisappear(animated: Bool) { super.viewDidDisappear(animated) // Remove listener with handle ref.removeObserverWithHandle(handle) } }