JSCoreTextHyperlinkView

August 20, 2011

Reading time ~1 minute

Since I've posted the JSTokenField project, I might as well post about my other open source pride and joy, JSCoreTextHyperlinkView.

The project includes an example of how to use the core text view. It's pretty simple - create the view with a 0 height frame, set the attributes, set its text, and then ask it for it's size so that the height is just correct. It will calculate based on the constraining width, and any padding that you set.

There is also a Twitter specific subclass that enables @usernames and #hashtags to be linkified.

Settable Attributes:

  • textAlignment
  • textColor
  • linkColor
  • highlightedLinkColor
  • fontName
  • fontSize
  • paddingTop
  • paddingLeft
  • backgroundImage
  • bgImageTopStretchCap
  • bgImageLeftStretchCap

To use CoreTextHyperlinkView in your apps:

  • Copy The contents of the AutoHyperlinks folder, and the files JSCoreTextView.h & .m and, if you want Twitter username and hashtag support, copy JSTwitterCoreTextView.h & .m too.
  • Link against the CoreText framework.

The Day I Was Hacked

It was 4am on a Saturday in 2013 and I was sleeping. My iPhone was sitting on my bedside table, plugged in in silent mode. It buzzed once...… Continue reading

Siri Remote - The Future of Gaming?

Published on September 20, 2015

Open Source Is Not 'Do What You Want'

Published on April 29, 2015