7

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.

2
  • Have you tried this Commented Apr 23, 2015 at 16:24
  • Please include what you have tried in your post. Commented Apr 23, 2015 at 16:38

1 Answer 1

33
label.textAlignment = NSTextAlignment.Justified
Sign up to request clarification or add additional context in comments.

2 Comments

the question relates to a UITextView and not a UILabel
@Edward True, but the effect is the same in this case. The textAlignment setter is also available on a UITextView.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.