The class reference _recommends_ not providing a Cancel button for an action 
sheet that presents in a popover — the user can easily cancel by tapping 
elsewhere. ("there are times when you should not include a cancel button") 
<xcdoc://ios/documentation/UIKit/Reference/UIActionSheet_Class/Reference/Reference.html>
 The HIG is indirect, recommending a Cancel button for the iPhone, but silent 
on whether it means _only_ on the iPhone.

But if the action sheet is to cascade from another popover, the class reference 
says you must provide one. The HIG is silent. Also, the HIG implies that a 
Cancel button should be added like any other button, which puzzles me about how 
to handle the special decoration a Cancel button requires.

A Google search on stackoverflow.com tells me that if a Cancel button is 
specified on iPad, it will bump the last button from the sheet. So much for 
"should not." I haven't made the experiment of cascading the sheet on a popover.

When I'm off work, I'll try the experiment and file a documentation bug.

        — F

On 2 Oct 2013, at 11:33 AM, Markus Spoettl <ms_li...@shiftoption.com> wrote:

> Hello,
> 
>  I just came across the following, would someone confirm this:
> 
>    UIActionSheet *sheet =
>         [[UIActionSheet alloc] initWithTitle:nil
>                     delegate:self
>            cancelButtonTitle:@"Cancel"
>       destructiveButtonTitle:nil
>            otherButtonTitles:nil];
> 
>    [sheet addButtonWithTitle:@"Button1"];
>    [sheet addButtonWithTitle:@"Button2"];
> 
>    [sheet showFromRect:someRect inView:someView animated:YES];
> 
> On the iPad (both device and simulator) this produces a sheet with "Button2" 
> missing. No matter how many buttons one adds, the last one added goes missing.
> 
> On iPhone (again both device and simulator) this produces a sheet with the 
> expected buttons "Cancel", "Button1", "Button2".
> 
> If I set the cancelButtonTitle: parameter to nil, both iPad and iPhone behave 
> correctly, iow "Button1", "Button2".
> 
> This is on iOS 7.0, Xcode 5.0 (5A1413).
> 
> Regards
> Markus
> -- 
> __________________________________________
> Markus Spoettl
> _______________________________________________
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/fritza%40manoverboard.org
> 
> This email sent to fri...@manoverboard.org


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to