Skip to content

15458434/LinkInNSTextField

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

LinkInNSTextField

Example of how to create a clickable link in a NSTextField

When you want to create a clickable Hyperlink inside an NSTextField all you need to do is the following. Turn your String to an NSAttributedString and add a [NSLinkAttributeName: "http://yoururl.example/"] over the range you want to have clickable. As soon as you add the attributedString to the attributedStringValue of the NSTextField, the text field will display the range as a clickable thing.

The only draw back in this. For the NSTextField it is impossible to change it's color. As far as I can tell.

About

How to create a clickable link in a NSTextField

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages