Set Hyperlink button in iOS Swift

func setHyperLink() {
        let text: String = self.currentTitle!
        let dictAttribute: [String: AnyObject] = [NSAttributedStringKey.underlineStyle.rawValue:NSUnderlineStyle.styleSingle.rawValue as AnyObject, NSAttributedStringKey.foregroundColor.rawValue:(self.titleLabel?.textColor)!]
        self.titleLabel?.attributedText = NSAttributedString(string: text, attributes: dictAttribute as? [NSAttributedStringKey : Any])
}