mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Refactor libphonenumber and TelegramAPI out of TelegramCore
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
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 ?? "")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user