Created
January 21, 2022 12:41
-
-
Save oguzhanvarsak/7f4efad57514929da47f14fa6e9ffa48 to your computer and use it in GitHub Desktop.
Alert View contains an Image View inside.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let showAlert = UIAlertController(title: "<#Title#>", message: "<#Message#>", preferredStyle: .alert) | |
let imageView = UIImageView(frame: CGRect(x: <#Int#>, y: <#Int#>, width: <#Int#>, height: <#Int#>)) | |
imageView.image = <#UIImage#> | |
showAlert.view.addSubview(imageView) | |
let height = NSLayoutConstraint(item: showAlert.view, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: <#Int#>) | |
let width = NSLayoutConstraint(item: showAlert.view, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: <#Int#>) | |
showAlert.view.addConstraint(height) | |
showAlert.view.addConstraint(width) | |
showAlert.addAction(UIAlertAction(title: "<#Button Text#>", style: .default, handler: { action in | |
<#Action#> | |
})) | |
self.present(showAlert, animated: true, completion: nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment