I'm working on a simple app and add programatically NSAttributedString
.
I am really confused how to move present viewcontroller
to another viewcontroller
.
This is not duplicate question because my question for how move to view controller and duplicatie question how to open link on click How can I make a clickable link in an NSAttributedString?.
Screen shot
In above image show three NSAttributedString
first one is dhiman.sham1gmail.com
and second one ishas started following
and third one Sham
. When trying to click on Sham
no action perform. i want to move this controller to another controller when click on Sham
.
This is my Code:
@IBOutlet weak var descriptionLbl: UILabel!
override func updateWithModel(_ model: AnyObject) {
self.descriptionLbl.attributedText = self.followingGetTextFromType(data: (model as? FollowingNotificationData)!)
}
func followingGetTextFromType(data:FollowingNotificationData) -> NSMutableAttributedString{
var attributedString = NSMutableAttributedString()
attributedString = NSMutableAttributedString(string:(data.detailsNoti?.fullName)!, attributes: strres)
let startedfollowing = NSMutableAttributedString(string:" has started following ", attributes: attrs)
attributedString.append(startedfollowing)
var discription = NSMutableAttributedString()
if data.fullName == ""{
discription = NSMutableAttributedString(string:"\((data.userName)!)", attributes: strres)
}else{
discription = NSMutableAttributedString(string:"\((data.fullName)!)", attributes: strres)
}
attributedString.append(discription)
}
Can someone please explain to me how to solve this , i've tried to solve this issue but no results yet.
Any help would be greatly appreciated.
Thanks in advance.