3

I was exploring the new Apple Music app the other day, and found a rather peculiar action sheet...

A peculiar action sheet

Until now, I didn't know either UIAlertController or UIActionSheet could have dividers like this! Come to think of it, how did they get that top button to look like a table view cell?

I have poured over both the UIActionSheet, UIAlertController, and UIAlertAction documents without success. So far as I know, Apple doesn't look kindly to subclassing these, or messing with the view hierarchy.

My questions then, are as follows:

  • How can I reproduce those thicker divider thingies on my own action sheets?
  • How can I reproduce that top button, with an image and descriptive text below the main action body?
  • Is there any current API that provides this functionality?

Any guidance would be much appreciated. Thank you in advance.

AverageHelper
  • 2,144
  • 2
  • 22
  • 34

1 Answers1

6

This is a normal UIAlertController or UIActionSheet but the last sheet has a custom view which is an image and 2 label

you can see these questions if you want to know how to produce that with the normal UIActionSheet but it's a little tricky

First Question

Second Question

Third Question

Ch Tut

or if you don't want to use any hacks on UIActionSheet or UIAlertController you may use these library as a replacement for Action Sheets JGActionSheet

other libraries

ahkactionsheet

rmactioncontroller

sgactionview

Community
  • 1
  • 1
Amr Mohamed
  • 2,290
  • 4
  • 20
  • 39
  • Thanks for the answer! However, while this solves the issue of adding images to alert actions, this doesn't mention the slightly larger dividing borders between some of the buttons in Apple's implementation. I'll mark this as my chosen answer for now. – AverageHelper Jul 21 '15 at 17:13
  • In the meantime, I'll hope Apple provides us a hint or two in a future release of the SDK. – AverageHelper Jul 21 '15 at 17:14