uialertview - Add Image in Alert Message box Title with Swift 3 - Stack Overflow

PHOTO EMBED

Mon Oct 31 2022 06:03:39 GMT+0000 (Coordinated Universal Time)

Saved by @Raihan #swift

let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert)

let action = UIAlertAction(title: "OK", style: .default, handler: nil)

let imgTitle = UIImage(named:"imgTitle.png")
let imgViewTitle = UIImageView(frame: CGRect(x: 10, y: 10, width: 30, height: 30))
imgViewTitle.image = imgTitle

alert.view.addSubview(imgViewTitle)
alert.addAction(action)

self.present(alert, animated: true, completion: nil)
content_copyCOPY

https://stackoverflow.com/questions/42478380/add-image-in-alert-message-box-title-with-swift-3