Created
May 30, 2015 11:02
-
-
Save jeffbailey/b5b8b0b60016516e05ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks to http://radex.io/watch/hyphenation/?utm_campaign=iOS%2BDev%2BWeekly&utm_source=iOS_Dev_Weekly_Issue_200 | |
extension WKInterfaceLabel { | |
func setHyphenatedText(text: String) { | |
let style = NSMutableParagraphStyle() | |
style.hyphenationFactor = 1 | |
let attributes = [NSParagraphStyleAttributeName: style] | |
setAttributedText(NSAttributedString(string: text, attributes: attributes)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment