NSMakeRange: Legacy Constructor Violation: Swift constructors are preferred over legacy convenience functions.

Viewed 2466

I am using the following code for providing with the line spacing between the UILabel text.

let daysAttrString = NSMutableAttributedString(string: allDays)
  let paragraphStyle = NSMutableParagraphStyle()
  paragraphStyle.lineSpacing = 7
  paragraphStyle.minimumLineHeight = 7
  daysAttrString.addAttribute(NSParagraphStyleAttributeName, value:paragraphStyle, range:NSMakeRange(0, daysAttrString.length))
  cell.operationalDays.attributedText = daysAttrString

But i am getting the following warning as shown below when using SwiftLint:

Legacy Constructor

Why it is being shown and how to resolve this?

0 Answers
Related