Reimplement video stickers

This commit is contained in:
Ilya Laktyushin
2022-01-27 13:06:44 +03:00
parent 97f224f0a8
commit bbc082e991
60 changed files with 1611 additions and 1462 deletions

View File

@@ -263,14 +263,20 @@ public func trimToLineCount(_ text: String, lineCount: Int) -> String {
if lineCount < 1 {
return ""
}
let lines = text.split { $0.isNewline }
var result = ""
for line in lines.prefix(lineCount) {
var i = 0
text.enumerateLines { line, stop in
if !result.isEmpty {
result += "\n"
}
result += line
i += 1
if i == lineCount {
stop = true
}
}
return result
}