В Swift4.1 и Xcode 9.3.1 я получаю ошибку
Тип 'Строка' не имеет члена 'documentType'
do {
let modifiedFont = NSString(format:"<span style=\"font-family: '-apple-system', 'HelveticaNeue'; font-size: 16\">%@</span>" as NSString, string) as String
let data = modifiedFont.data(using: String.Encoding.utf8, allowLossyConversion: true)
if let d = data {
let str = try NSAttributedString(data: d,
options: [.documentType : NSAttributedString.DocumentType.html],
documentAttributes: nil)
return str
}
}
Как