I want to add another button other than the \"OK\" button which should just dismiss the alert. I want the other button to call a certain function.
var logInE
See my code:
@IBAction func foundclicked(sender: AnyObject) {
if (amountTF.text.isEmpty)
{
let alert = UIAlertView(title: "Oops! Empty Field", message: "Please enter the amount", delegate: nil, cancelButtonTitle: "OK")
alert.show()
}
else {
var alertController = UIAlertController(title: "Confirm Bid Amount", message: "Final Bid Amount : "+amountTF.text , preferredStyle: .Alert)
var okAction = UIAlertAction(title: "Confirm", style: UIAlertActionStyle.Default) {
UIAlertAction in
JHProgressHUD.sharedHUD.loaderColor = UIColor.redColor()
JHProgressHUD.sharedHUD.showInView(self.view, withHeader: "Amount registering" , andFooter: "Loading")
}
var cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel) {
UIAlertAction in
alertController .removeFromParentViewController()
}
alertController.addAction(okAction)
alertController.addAction(cancelAction)
self.presentViewController(alertController, animated: true, completion: nil)
}
}