Anthony Anthony - 7 months ago 48
Swift Question

Swift 2 - put 3 action buttons in the same line using the UIAlertController

is there a way to display 3 action buttons into UIAlertController and to be on the same line ?


I don't think you can place 3 UIAlertActions adjacent to each other using UIAlertController. And I suggest you not to do that.

Most designs in iOS have a reason behind it. This "3 UIAlertActions can't be placed adjacent to each other" design is one of those. Think about why it doesn't allow you to do this.

The UIAlertView that a UIAlertController controls is tiny. And users' fingers are large. If we squeeze all three buttons into one row. Each of them will be very small. As a result, the user might mis-tap! You might not understand this on the Simulator, but try this on a real phone:

Put 3 small UIViews adjacent to each other. And put touch detection code for all three of them. Now try to touch one of the views. You will find that it's hard. You will have to aim for it.

TL;DR: The UX will be very bad if you put three buttons adjacent to each other.