Avatar ·

How to control line spacing in UILabel (Swift)

Hello everyone! I'm a beginner in iOS development with Swift, and I'm having a problem with UILabel. I need the text in the label to display with increased line spacing — similar to the CSS line-height property. By default, UILabel uses standard line spacing, which looks too tight for my design. I've tried using font attributes, but nothing works. Here's my current code: ```swift let label = UILabel() label.text = "This is a long text that should be displayed in multiple lines. I need more space between the lines." label.numberOfLines = 0 label.font = UIFont.systemFont(ofSize: 16) label.textAlignment = .left ``` I've read that I can use NSAttributedString with NSMutableParagraphStyle, but when I do that,