another.im-ios/AnotherIM/Helpers/Binding+Extensions.swift
2024-10-31 12:43:16 +01:00

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
}
}