Justify-aligning text in a text view in swift

Matt Spoon picture Matt Spoon · Apr 23, 2015 · Viewed 7.8k times · Source

It's a pretty trivial question I know, but I have to be able to justify-align the text in a text view using swift. It is an already existing text view on the storyboard which has been hooked up to an outlet, let's call it justifyTextView.

Can anybody give some code for this? I can't seem to find anything online about it.

Answer

Shuo picture Shuo · Apr 23, 2015
label.textAlignment = NSTextAlignment.Justified