When using a UIAlertController
, if I want to present a UIActionSheet
with an empty title and an empty message, the frame for the expected placement
UIAlertController *controller=[UIAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:UIAlertControllerStyleAlert];//style check
UIAlertAction *first = [UIAlertAction actionWithTitle: @"Login with Facebook" style: UIAlertActionStyleDefault handler:^(UIAlertAction *action)
{
//write to perform action
}];
[controller addAction: first];
UIAlertAction *second = [UIAlertAction actionWithTitle: @"Guest User" style: UIAlertActionStyleDefault handler:^(UIAlertAction *action)
{ //write to perform action
}];
[controller addAction:second];
UIAlertAction *third=[UIAlertAction actionWithTitle:@"Registered User" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action)
{
//write to perform action
}];
[controller addAction:third];
[self presentViewController: controller animated: YES completion: nil];