如何在警报中添加网址?

Sha*_*ain 1 nsurl swift uialertcontroller

是否有方法为寻找其他信息的用户添加网址?我的警报看起来像这样

let alert = UIAlertController(title: "Alert details", message: "For more detailed information, click the link below", preferredStyle: UIAlertControllerStyle.Alert)
    // add url here
    let okayAction = UIAlertAction(title: "Ok", style: .Default) { (action) in
        print(action)
    }
    alert.addAction(okayAction)
Run Code Online (Sandbox Code Playgroud)

我们的想法是将它们重定向到网页并关闭应用程序中的UIAlertController

mat*_*att 7

您不能将任意接口添加到UIAlertController.标题和消息不可点击.您无法添加更多文字.而是添加另一个按钮(UIAlertAction),将它们定向到网页.要么是这样,要么使用其他界面而不是UIAlertController(例如,你可以建立一个看起来像警报的呈现视图控制器).