Answer the question
In order to leave comments, you need to log in
How to remove delimiter between words when moving to a new line?
The problem is to remove the dot if the words are wrapped to a new line.
let anotherInfo = info
.compactMap { $0 }
.filter { !$0.isEmpty }
.joined(separator: " · ")
.with(color: .okkoLightWhiteText)
let result = NSMutableAttributedString()
if rating.length > 0 {
result += rating
result += value.displayInfo.rating.count >= 3 ? "\n" : " "
}
result += anotherInfo
return .init(text: result, style: .regularText, numberOfLines: 0)
if anotherInfo.length.words > n {
...
}
print("\(anotherInfo)")
Answer the question
In order to leave comments, you need to log in
And you try your application on a device with a different screen resolution .... Your transfer will be in a different place ....
Conclusion - count the width of the letters, the width of the element, the number of letters that fit into one line, and delete the dot that is not needed .
.... or - immediately divide the text into two lines, concatenating them then through the line break character.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question