I am struggling the last couple of days to figure out if these alerts are part of UIKit
or just a private custom view. I don't even know how they properly called. The UI team have asked for an alert that looks like the one appears in Apple's News and Podcast apps. See screenshots below.

- 314,917
- 42
- 532
- 579

- 756
- 1
- 11
- 26
-
Possible dupe? https://stackoverflow.com/questions/26518520/how-to-make-a-smooth-rounded-volume-like-os-x-window-with-nsvisualeffectview – Ssswift Sep 28 '17 at 16:48
-
Is it possible to create a custom `UIAlertViewController` class? – ProgrammingEnthusiast Sep 28 '17 at 16:55
-
@Ssswift not a duplicate – Alec O Sep 30 '17 at 00:46
2 Answers
Apple's code to perform this is not part of UIKit. It will need to be implemented by you! I made a framework to do just this on GitHub called AOModalStatusView (https://github.com/alecdoconnor/AOModalStatusView).
The easiest way to do this would be with a custom view presented modally and with the presentation style set to "over current context" so that what is behind the view shows through. Inside the view create a square that is centered on the view. Give it rounded corners and a specific width and height. In order to get the blurred background you should use Apple's "Visual Effects View with Blur" or "Visual Effects View with Blur and Vibrancy." (https://shrikar.com/ios-development-tutorial-visual-blur-with-uivisualeffectview/)
In the view controller for this view, set a timer shortly in viewDidAppear(..) that will run dismiss(animated: true, completion: nil)

- 1,697
- 1
- 18
- 31
-
-
@OutOfBoundsException I don't typically cross-post personal material on SO, but your question inspired me to write a framework for these modal status views. You can find it on GitHub at https://github.com/alecdoconnor/AOModalStatusView with an example of it at https://github.com/alecdoconnor/PuppyParadise Tutorial will be coming soon too, will update then. – Alec O Oct 14 '17 at 17:33
You can use my own StatusAlert framework written in Swift. It gives you ability to show Apple system-like alert as well as present the same alert without an image, title or message anywhere in UIView
.
It is available via Cocoapods and Carthage and supports iPhone X, Safe Areas layout, iPads and allows some customizations.

- 424
- 4
- 8