Avatar ·

Cómo gestionar el interlineado en UILabel (Swift)

¡Hola a todos! Soy nuevo en el desarrollo de iOS con Swift y tengo un problema con UILabel. Necesito que el texto en la etiqueta se muestre con un espacio aumentado entre líneas, algo así como la propiedad line-height en CSS. Por defecto, UILabel usa un interlineado estándar que se ve demasiado apretado para mi diseño. He intentado usar atributos de fuente, pero no funciona. Aquí está mi código actual: ```swift let label = UILabel() label.text = "Este es un texto largo que debe mostrarse en varias líneas. Necesito que haya más espacio entre las líneas." label.numberOfLines = 0 label.font = UIFont.systemFont(ofSize: 16) label.textAlignment = .left ``` He leído que se puede usar NSAttributedString con NSMutableParagraphStyle, pero cuando lo hago, el texto no se muestra o permanece sin cambios. ¿Quizás me estoy perdiendo algo? Por favor, indíquenme cómo configurar correctamente el interlineado en UILabel en Swift. ¿Es necesario usar NSAttributedString?