1

I want to build open-in like UI (see picture below).

It should include a list of icons representing actions and cancel button. I want pretty much UIAlertController only with icons (vs plain text).

Is there a standard iOS control which does something like or that or will I have to build/find a custom UI control for that?

enter image description here

Victor Ronin
  • 22,758
  • 18
  • 92
  • 184
  • @AlejandroIván I believe it's deprecated in iOS 8 – Victor Ronin Feb 23 '16 at 01:29
  • In Apple's docs I see `UIActivity`, `UIActivityViewController` (this ^) and `UIActionSheet`. Yes, `UIActionSheet` was deprecated in iOS8. https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIActivity_Class/index.html Also see this related question: http://stackoverflow.com/questions/20891730/uiactivityviewcontroller-with-custom-uiactivity-displays-color-image-as-gray – mc01 Feb 23 '16 at 01:29
  • @mc01 Yeah. It looks so. Do you want to extract it as the answer, so people can upvote? – Victor Ronin Feb 23 '16 at 01:33

1 Answers1

2

From Apple's docs, each displayed service/action is a UIActivity, which is an abstract class, displayed in a UIActivityViewController which you can customize. There are several built-in services, and you can create your own w/custom icons. Yes, UIActionSheet was deprecated in iOS8.

The UIActivityViewController class is a standard view controller that you can use to offer various services from your application. The system provides several standard services, such as copying items to the pasteboard, posting content to social media sites, sending items via email or SMS, and more. Apps can also define custom services.

Your app is responsible for configuring, presenting, and dismissing this view controller. Configuration for the view controller involves specifying the data objects on which the view controller should act. (You can also specify the list of custom services your app supports.) When presenting the view controller, you must do so using the appropriate means for the current device. On iPad, you must present the view controller in a popover. On iPhone and iPod touch, you must present it modally.

Also see this related question on some image gotchas ... And this tutorial on adding a custom UIActivity to the view.

Community
  • 1
  • 1
mc01
  • 3,750
  • 19
  • 24