How to hide title/message frame in a UIAlertController?

Update Swift 4:

let alert = UIAlertController(title: nil, message: nil, preferredStyle: UIAlertControllerStyle.actionSheet)

Just need to pass nil to title and message params.


When I create a UIAlertController with this code I don't have the title spacing.

[UIAlertController alertControllerWithTitle:nil
                                    message:nil
                             preferredStyle:UIAlertControllerStyleActionSheet];

Are you passing in nil for the title and message or empty strings?


If you want to change in run time depending on a certain case just write:

actionController.title = nil
actionController.message = nil