Skip to content

Instantly share code, notes, and snippets.

@3257
Created April 7, 2018 14:57
Show Gist options
  • Save 3257/624ff0447043fbcd22ce131fa25217b1 to your computer and use it in GitHub Desktop.
Save 3257/624ff0447043fbcd22ce131fa25217b1 to your computer and use it in GitHub Desktop.
@IBAction func didTapSubmit(_ sender: UIButton) {
// Get properties for the unicorn-to-be-created
let addedBy = self.addedBy.text ?? ""
let seenAt = self.seenAt.text ?? ""
let unicorn = Unicorn(imagePath: storageImagePath, addedBy: addedBy, seenAt: seenAt)
// Create the unicorn and record it
writeUnicornToDatabase(unicorn)
// Return to Unicorns Table VC
navigationController?.popViewController(animated: true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment