I am building an app with a UIAlertController, and I want to have a button that says "Share" and then opens up something like
it seems easy to do, if it wasn't a sub-button.
My Code:
}
@IBAction func buttonTapped(sender: UIButton) {
var title: String
if sender.tag == correctAnswer {
title = "Correct"
++score
} else {
title = "Wrong"
let ac = UIAlertController(title: title, message: "Your score was \(score).", preferredStyle: .Alert)
ac.addAction(UIAlertAction(title: "Try Again", style: .Default, handler: askQuestion))
ac.addAction(UIAlertAction(title: "Share", style: .Default, handler: share))
presentViewController(ac, animated: true, completion: nil)
gameOver = true
score = 0
}
My share function is currently not defined.