mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
16 lines
406 B
Swift
16 lines
406 B
Swift
import Foundation
|
|
import libphonenumber
|
|
|
|
public final class InteractivePhoneFormatter {
|
|
private let formatter = NBAsYouTypeFormatter(regionCode: "US")!
|
|
|
|
public init() {
|
|
}
|
|
|
|
public func updateText(_ text: String) -> (String?, String) {
|
|
self.formatter.clear()
|
|
let string = self.formatter.inputString(text)
|
|
return (self.formatter.regionPrefix, string ?? "")
|
|
}
|
|
}
|