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
}