Multi line SKLabels in Swift

Updated for Swift 3!

Sometimes Apple seems to have made some pretty obvious oversights – a SKLabel without multi-line capability? Strange.

I’ve had a look at some third party solutions and each seemed to have their own limitations. Here is my take on a multiline SKLabel in Swift (doesn’t account for \n but does account for word wrapping)

Interactive developer, Author - iOS development with Swift - book coming 2017 https://manning.com/books/ios-development-with-swift

Tagged with:
Posted in Swift
One comment on “Multi line SKLabels in Swift
  1. Thank you so much super helpful. Saved me a huge head ache from having to figure this out myself.

    I also needed
    required init(coder: NSCoder) {
    fatalError(“NSCoding not supported”)
    }

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: