I want to write on the same line of my tableview cell detailTextLabel.
For example
Left string right string
.
I\'m doing this :
It's possible to indirectly use NSTextTable which is unavailable on iOS.
If you create html table like:
Left string
Right string
And then convert it to an attributed string like that way:
extension NSAttributedString {
convenience init?(html: String) {
guard let data = html.data(using: .utf8) else {
return nil
}
try? self.init(data: data, options: [
NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType,
NSCharacterEncodingDocumentAttribute: String.Encoding.utf8.rawValue
], documentAttributes: nil)
}
}
You will get exactly what you need and if you check paragraph attributes in that attributed string - you will see NSTextTable there.