fmodf
b3b3b3aef7
Reviewed-on: narayana/conversations-classic-ios#1 Co-authored-by: fmodf <fmodf.ios@gmail.com> Co-committed-by: fmodf <fmodf.ios@gmail.com>
13 lines
289 B
Swift
13 lines
289 B
Swift
import SwiftUI
|
|
|
|
extension Binding where Value == String {
|
|
func max(_ limit: Int) -> Self {
|
|
if wrappedValue.count > limit {
|
|
DispatchQueue.main.async {
|
|
wrappedValue = String(wrappedValue.dropLast())
|
|
}
|
|
}
|
|
return self
|
|
}
|
|
}
|