2

I have this code:

func alertBox(txt: String){
        let ac = UIAlertController(title: "MyTtle" , message: "More information in my website: ", preferredStyle: .alert)
        let ramkaNaObrazek = CGRect(origin: CGPoint(x: 10, y: 10), size: CGSize(width: 30, height: 30))
        let ikonaAlertu = UIImageView(frame: ramkaNaObrazek)
        ikonaAlertu.image = UIImage(named: "modal_podpowiedz")
        ac.view.addSubview(ikonaAlertu)
        ac.addAction(UIAlertAction(title: "Ok" , style: .cancel, handler: { (action: UIAlertAction!) in
        }))
        present(ac, animated: true)
    }

I would like to add after this text: "More information in my website:" + www - a link to my website (http://www.myname.pl).

How can I do this?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Łukasz Betta
  • 131
  • 3
  • 12

1 Answers1

2

You can't add custom fields like text views with clickable links to a UIAlertController. You will need to either create your own modal view controller that acts like a UIAlertController or use a third party framework that does it for you.

Duncan C
  • 128,072
  • 22
  • 173
  • 272