Recipe: Custom Modal Alert View

The simplicity and lack of flexibility of the UIAlertView is often too limiting. While Recipe 3-3 provides a simple modal overlay that is perfect for providing progress during long-running tasks, sometimes you want a fully capable and configurable alert view that doesn’t have the artificial restrictions that Apple places on UIAlertView.

Recipe 3-4 provides an alert view that is nearly fully customizable. You can add subviews and configure any element of the UI to meet your needs, including borders, backgrounds, and subview placement. Bypassing the built-in alert allows for custom transition animations. Recipe 3-4 provides a bounce effect during presentation and dismissal. The bounce is implemented with an affine ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.