Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 970 Bytes

README.md

File metadata and controls

26 lines (17 loc) · 970 Bytes

UIAlertControllerDimmed

Subclasses UIAlertController and turns the background black and white.

Usage

Standard UIAlertController

let alertController: UIAlertController = UIAlertController(title: nil, message: "Message", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: .cancel, handler: nil))
present(alertController, animated: true, completion: nil)

UIAlertControllerDimmed

let alertController: UIAlertControllerDimmed = UIAlertControllerDimmed(title: nil, message: "Message", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: .cancel, handler: nil))
alertController.presentWithGrayBackground()

Simply use UIAlertControllerDimmed instead of UIAlertController and call presentWithGrayBackground.

SO question that led to that repo