mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Reimplement video stickers
This commit is contained in:
parent
97f224f0a8
commit
bbc082e991
60 changed files with 1611 additions and 1462 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue