Created
May 4, 2016 20:51
-
-
Save tobeiosdev/44eb57e7fc7ccc182900f67d8cef0b95 to your computer and use it in GitHub Desktop.
This file contains 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
var testArray = [String]() | |
var initialLoad = true | |
override func viewDidLoad() { | |
DataService.ds.REF_TITLE.observeEventType(.ChildAdded, withBlock: { snapshot in | |
let lastName = snapshot.key as String | |
self.testArray.insert(lastName, atIndex: 0) | |
}) | |
DataService.ds.REF_TITLE.observeSingleEventOfType(.Value, withBlock: { snapshot in | |
if self.initialLoad == true { | |
self.tableView.reloadData() | |
self.initialLoad = false | |
} | |
}) | |
} | |
@IBAction func refreshBtn_clicked(sender: AnyObject) { | |
tableView.setContentOffset(CGPointZero, animated: true) | |
self.tableView.reloadData() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment