Check out example codes for "swift negative line spacing". It will help you in understanding the concepts better.

Code Example 1

var attrString = NSMutableAttributedString(string: labelText)
var style = NSMutableParagraphStyle()
let minMaxLineHeight = font.pointSize - font.ascender + font.capHeight
let offset = NSNumber(value: Float(font.capHeight - font.ascender))
let range = NSRange(location: 0, length: labelText.length)
style.minimumLineHeight = minMaxLineHeight
style.maximumLineHeight = minMaxLineHeight
if isCentered {
    style.alignment = .center
}
attrString.addAttribute(.paragraphStyle, value: style, range: range)
attrString.addAttribute(.baselineOffset, value: offset, range: range)

labelText.attributedText = attrString

Learn ReactJs, React Native from akashmittal.com