I'm making a database with firebase.
@IBAction func addPost(_ sender: Any) {
// Post the data to firebase
ref?.child("Posts").childByAutoId().setValue("Hello Firebase")
// Dismiss the popover
presentingViewController?.dismiss(animated: true, completion: nil)
}
The above code is working correctly and like this
and I change it to the code below:
@IBAction func addPost(_ sender: Any) {
// Post the data to firebase
ref?.child("Posts").childByAutoId().setValue(textView.text)
// Dismiss the popover
presentingViewController?.dismiss(animated: true, completion: nil)
}
after changing it I get:
"fatal error: unexpectedly found nil while unwrapping an Optional value" error occurred....
How can I fix it?