Skip to content

Instantly share code, notes, and snippets.

@zontan
Created September 9, 2020 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zontan/d6b9076f9a021d7354ecc39ed3712aad to your computer and use it in GitHub Desktop.
Save zontan/d6b9076f9a021d7354ecc39ed3712aad to your computer and use it in GitHub Desktop.
var liveRef: DatabaseReference!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
liveRef = Database.database().reference(withPath: "live")
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "GoLive" {
liveRef.child(userName).setValue("true")
if let banubaView = segue.destination as? ViewController {
banubaView.roomName = sender as? String
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment