mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Reimplement video stickers
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user