1

Can we put a tappable link in the alert body? Tapping the link should open the Mail client. My pressing question is that has anyone tried it and is it accepted by apple.

The alert says 'Please contact Helpdesk for more information' with an OK button - tap on 'helpdesk' and it should open the mail client.

Floern
  • 33,559
  • 24
  • 104
  • 119
Prathiba
  • 287
  • 2
  • 4
  • 15
  • 1
    A much better way would be to simply use "Send Mail" and "Cancel" as buttons. An "OK" alert with a obscure link in the body that you have to touch to trigger an action is bad UI. – Matthias Bauch May 22 '13 at 12:59

2 Answers2

4

From the Apple Documentation in regards to UIAlertView Class Reference

Subclassing Notes

The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.

So to get the sort of customization you are talking about you would have to subclass UIAlertView which is not allowed, your app will be rejected.

However there are some alternatives to UIAlertView implementations that can be found cocoa controls.

You could just have a button that does the same as the link and than you could just use this method

- (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex;

To determine which button was pressed then run your mail client.

Popeye
  • 11,839
  • 9
  • 58
  • 91
2

I think While these kind of adding customizations to a UIAlertView is strongly discouraged by Apple You can Use the UIAlertView delegate Function to detect which button is pressed and can reaction on as required.

UIAlertView *alert = [[UIAlertView alloc] init withWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Your Event you want fire", nil];

- (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
   switch(index)
        case 1:
              //fire Your Event you want fire
              break;
}

And if you looking some kind of change with UIAlertView One option will you cn create you own Custom AlertView try this link SO Questions

Buntylm
  • 7,345
  • 1
  • 31
  • 51