Custom alert view


Notes on custom UIAlertController

Resources:

Code

/**
 * Add
 * - Note: ref: https://stackoverflow.com/a/38621779
 * - Note: remove overlay: overlay.removeFromSuperview()
 */
@discardableResult func addBlurOverlay() -> UIVisualEffectView {
	let blurEffect = UIBlurEffect(style: .systemUltraThinMaterial)
	let blurView = UIVisualEffectView(effect: blurEffect)
	blurView.frame = UIScreen.main.bounds // self.bounds
	//blurEffectView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight] // for supporting device rotation
	view.addSubview(blurView)
	return blurView
}
  • Ref: https://stackoverflow.com/a/47925120/5389500
  • Related: https://github.com/pmusolino/PMAlertController
  • Related: https://github.com/vikmeup/SCLAlertView-Swift
  • Related: https://williamboles.me/finding-hope-with-custom-alerts/
  • https://github.com/pmusolino/PMAlertController
  • https://github.com/vikmeup/SCLAlertView-Swift
  • https://williamboles.me/finding-hope-with-custom-alerts/
  • For macOS and iOS: https://github.com/sentryco/UpgradeAlert