How to control the line spacing in UILabel
// Usage: setTextWithLineSpacing(myEpicUILabel,text:"Hello",lineSpacing:20)
func setTextWithLineSpacing(label:UILabel,text:String,lineSpacing:CGFloat)
{
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineSpacing = lineSpacing
let attrString = NSMutableAttributedString(string: text)
attrString.addAttribute(NSAttributedString.Key.paragraphStyle, value:paragraphStyle, range:NSMakeRange(0, attrString.length))
label.attributedText = attrString
}
Also in Swift:
- swift VStack
- disable commit editing style swift
- swift ns_enum generic name
- swift collectionview scrolltoitem
- swift share with
- check if nan swift
- swift test if simulator
- how to know when text changed textfield swiftui
- swift increase int value
- send email with swiftmailer symfony
- change placeholder color swift
- get device height spritekit
- swift string concatenation
- get difference between two arrays swift
- swiftui font color
- alertdialog flutter
- swift thread.sleep
- swift initialize a view
- how to get index path cell collection view from ui longpress gesture swift
- get files with file type swift
- deselect all cell in collectionview
- meu eclipse não gera a implementação do mapstruct
- loop backwards swift
- reverse list swift