Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 747 Bytes

File metadata and controls

24 lines (16 loc) · 747 Bytes

CustomAlertPresentationController

CustomAlertPresentationController is a UIPresentationController which mimics iOS' native UIAlertController presentation, modal display, and dismissal. It is written in Swift 4.

It can be used to present any UIViewController in the same style as an iOS alert.

Example Usage

final class ViewController: UIViewController {

	let transitioningManager = CustomAlertTransitioningManager()

	// ... 

	func displayCustomAlert() {
		let customAlertController = MyCustomAlertController()
	        customAlertController.transitioningDelegate = transitioningManager
        	customAlertController.modalPresentationStyle = .custom
        	present(customAlertController, animated: true)
	}

}