Ipad ShareKit's UIActionsheet Issue - ipad

The Sharekit's initial UIActionsheet displays the items Email, Twitter and Facebook and Cancel on Iphone
However the same code ported to Ipad now the Cancel option is missing on its UIActionsheet.
why is that.

Are you using the action sheet in a popover? The standard dismiss interaction for a popover is touching outside of it. There is rarely a "cancel" button in a popover action sheet, and Apple's HIG recommends against it.

Related

Hide the screenshot in multitasking switcher only in particular cases

Chase bank's iOS app is showing blank view hiding apps details when double tap the home button from the app. And when you login inside the app and touchID alert appears the apps view is not hidden by blank view.
So far I can hide app details by showing image loaded on applicationWillResignActive but it makes app hide it's details while touchID alert comes up.
I've checked similar questions on SO like this or this. Also here. But there is no answer to my question. How to replicate Chase bank's app behavior? How not to hide app details with touchID alert, but have them hidden when double tapped the home button?
I know it's an old question but couldn't find a valid answer to this exact question. So here's my solution.
steps:
create a instance variable for blocker view
init blocker view only once when it's necessary (I did it on applicationWillResignActive)
add blocker view as subview to the window at applicationDidEnterBackground
remove blocker view at applicationWillEnterForeground
The app delegate's applicationWillResignActive is the right place where you put a black or whatever view you want to show when the app is being moved to background. You need to add the desired UIView on Window object. Also you need to remove that view when the app becomes active again.

UIDocumentInteractionController presentation style

I am developing an app for iPad. I am able to show UIDocumentInteractionController for an item to open in other app successfully. But I have to change the presentation style of my UIDocumentInteractionController. It's opening in pop over, I want it to be like action sheet with cancel button.
Thanks in advance.

Is it safe to present UIAlertController (alert style) on iPad without popover?

In my app, I display a UIAlertController when the user taps on a button on the screen. I either use a UIAlertController or a UIAlertView, depending on the API availability (since my app supports both iOS 7 and 8).
I simply want to display an alert view to the user so I'm using the .Alert style for my UIAlertController.
When the user is on an iPad, is it safe to display the UIAlertController (Alert style) without configuring a popover?
I saw some tutorials online. From my understanding, if using a UIAlertController (Action Sheet style), I need to configure a popover or else the app will crash. I just want to know if it works the same way with an Alert style UIAlertController.
I did some test on my iPad and the app did not crash without the popover. But I want to make sure this is safe.
You never use a UIPopoverController with UIAlertView or UIAlertController (no matter its style).
iOS will internally use a popover on an iPad when the UIAlertController style is "action sheet" but you don't deal with that yourself.
So you have nothing to worry about. Use UIPopoverController as-is using the presentViewController:animated:completed: method no matter the device and you are fine.

How can I keep UIActionSheet from being dismissed when background touched?

The default behavior for the UIActionSheet used to be that touching the background did not dismiss it, and in fact did nothing. But with iOS 7 touching the background is equivalent to pressing the cancelButton.
I'm modifying some software that needs to be kept to the iOS 6 behavior. How can I keep touches of the background from dismissing the action sheet?
You can achieve this by not using a cancel button.
Check this SO post:
UIActionSheet in iOS7 dismissing when user taps ANYWHERE on the screen on iPhone

Cancel button on UIActionSheet on iPad

The iOS Human Interface Guide says that on an iPad "Do not include a Cancel button when the action sheet is displayed without animation, because people can tap outside the popover to dismiss the action sheet without selecting one of the other alternatives". As a result, the Cancel button is not shown in these cases.
This is NOT intuitive. People are used to seeing a Cancel option whenever an action that can be cancelled is shown, and they may get confused if they don't see one. They may not realize that tapping outside the popver means Cancel.
The reasoning of "clicking outside the window to cancel" could have been used for PCs and Macs as well, but it isn't. A Cancel button is displayed in these systems.
I'm inclined to include an artificial Cancel button, but I'm afraid that this is against Apple HIG policy and my App will be rejected.
What do you think?
As someone who just encountered the same issue, I agree. It's not intuitive whatsoever!
As for Apple's recommendations
"Do not include a Cancel button when the action sheet is displayed without animation, because people can tap outside the popover to dismiss the action sheet without selecting one of the other alternatives." (p121)
"An animated action sheet should include a Cancel button, because people need to be able to dismiss the action sheet without closing the popover" (p121)
Will Apple reject your app if you don't follow these guidelines? This answer may offer some insight:
Will Apple reject my app if I do not do this?

Resources