UITextView line spacing goes back to default when the .text value is changed
<p>On the attributes inspector, I set <code>.text</code> attribute in an <code>UITextView</code> tab as 'attributed' and then changed 'Line' value as 1.5.</p>

<p>When a new value is assigned to .text field in the <code>UITextView</code>, the line spacing is set back.</p>

<p><a href="https://i.stack.imgur.com/dlW3o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dlW3o.png" alt="enter image description here"></a></p>

<p>The left one is the view controller shown in <code>main.storyboard</code>, and the right one is the result after assigning <code>String</code> value in the <code>UITextView</code>, run in the simulator.</p>

<p>Is there like a constraint or something for me to fix the line spacing value after changing <code>.text</code>? I think it should be managed by codes..</p>

<pre><code>let style = NSMutableParagraphStyle()
style.lineSpacing = 40
let attributes = [NSParagraphStyleAttributeName : style]
aboutNeyong.attributedText =
NSAttributedString(string: aboutNeyong.text!, attributes:attributes)
</code></pre>

<p>The code above is what I added after the assigning statement.</p>