Ios 如何在swift中的报警控制器中创建可点击链接

Ios 如何在swift中的报警控制器中创建可点击链接,ios,swift,uialertcontroller,Ios,Swift,Uialertcontroller,我想要像这样的警告对话框。其中包含一个可单击的链接,如蓝色突出显示的文本。当用户单击该文本时,它将在浏览器中打开一个链接。为此,我使用第三方库 这是我的密码 func popUpMsg(){ let msg = "\n Hi Rahul! Welcome back to the early access queue for the app, Once you've been accepted into the beta, we'll notify you using the conta

我想要像这样的警告对话框。其中包含一个可单击的链接,如蓝色突出显示的文本。当用户单击该文本时,它将在浏览器中打开一个链接。为此,我使用第三方库

这是我的密码

func popUpMsg(){

    let msg = "\n Hi Rahul! Welcome back to the early access queue for the app, Once you've been accepted into the beta, we'll notify you using the contact info you have on file with Facebook. \n\n But just a second, if you haven't already done so, you can increase your odds of jumping ahead in the queue by telling us a little about yourself. Please complete our 4-question survey to give it a shot. \n" as NSString
    let range = msg.rangeOfString("complete our 4-question survey")

    let alert = SimpleAlert.Controller(title: "Early Access to Application", message: msg as String, style: .Alert)
    alert.configContentView = { view in
        if let view = view as? SimpleAlert.ContentView {
            view.titleLabel.textColor = UIColor.blackColor()
            view.titleLabel.font = UIFont.boldSystemFontOfSize(32)
            print(view.titleLabel.font)
            view.messageLabel.textColor = UIColor.grayColor()

            let attributedString = NSMutableAttributedString(string: msg as String)
            attributedString.addAttribute(NSLinkAttributeName, value: NSURL(string: "http://www.google.com")!, range: range)
            attributedString.addAttribute(NSUnderlineStyleAttributeName, value: NSNumber(int: 1), range: range)
            attributedString.addAttribute(NSUnderlineColorAttributeName, value: UIColor.whiteColor(), range: range)

            view.messageLabel.attributedText = attributedString
            view.messageLabel.font = UIFont(name: "arial", size: 27)
            print(view.messageLabel.font)

            view.textBackgroundView.layer.cornerRadius = 3.0
            view.textBackgroundView.clipsToBounds = true
        }
    }
    alert.addAction(SimpleAlert.Action(title: "OK", style: .OK))
    presentViewController(alert, animated: true, completion: nil)
}

那么你的问题是什么?为什么不在点击OK按钮的同时重定向实际页面?编程比在警报视图中链接更好。你是对的,但这不是我的客户要求……然后向你的客户解释苹果有用户体验指南,并告诉他最好遵循这些指南。(即使这些指导方针没有提到警报中文本中的链接)教育客户机是开发人员工作的一部分。无论指导方针与否,我也希望能够在UIAlertController的消息文本中创建超链接,并保留
OK
按钮以使控制器消失。我已经可以创建链接了,但它们(还)不可点击。