Refactor libphonenumber and TelegramAPI out of TelegramCore

This commit is contained in:
Peter
2019-10-18 11:35:04 +04:00
parent 3e6a37c1b2
commit 5f33b7ef51
53 changed files with 106 additions and 62 deletions

View File

@@ -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 ?? "")
}
}