Search code examples
swiftuialertcontroller

How to create my own UIAlertController in Swift 5?


I have graphic that I would like to create as a UIAlertController? Can I create a xib and then call that file to present it? What is the best way to do this?

enter image description here


Solution

  • An alert is nothing but a presented view controller. So make your own view controller and call present. It's as simple as that.