I want to remove a title section from an Alert action.
Making title string ""
won't remove the title section
@IBAction func addImage(sender: AnyObject!) {
let alert:UIAlertController = UIAlertController(title: "" ,message: nil, preferredStyle: UIAlertControllerStyle.ActionSheet)
let cameraAction = UIAlertAction(title: "Take Photo", style: UIAlertActionStyle.Default)
{
UIAlertAction in
self.openCamera()
}
let gallaryAction = UIAlertAction(title: "Choose Photo", style: UIAlertActionStyle.Default)
{
UIAlertAction in
self.openGallary()
}
let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel)
{
UIAlertAction in
}
// Add the actions
alert.addAction(cameraAction)
alert.addAction(gallaryAction)
alert.addAction(cancelAction)
// Present the controller
self.presentViewController(alert, animated: true, completion: nil)
}
This is what I'm getting:
How can I remove the title section all together?