mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-16 10:30:08 +00:00
16 lines
417 B
Swift
16 lines
417 B
Swift
import Foundation
|
|
import TelegramCorePrivateModule
|
|
|
|
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 ?? "")
|
|
}
|
|
}
|