Introduce digit delegate method on dial pad

This commit is contained in:
ismailgulek
2021-01-14 18:20:29 +03:00
parent 478d8f30c8
commit dbac4a3645
@@ -22,6 +22,8 @@ import libPhoneNumber_iOS
@objc protocol DialpadViewControllerDelegate: class {
func dialpadViewControllerDidTapCall(_ viewController: DialpadViewController, withPhoneNumber phoneNumber: String)
func dialpadViewControllerDidTapClose(_ viewController: DialpadViewController)
@objc optional func dialpadViewControllerDidTapDigit(_ viewController: DialpadViewController, digit: String)
}
@objcMembers
@@ -232,6 +234,10 @@ class DialpadViewController: UIViewController {
@IBAction private func digitButtonAction(_ sender: DialpadButton) {
let digit = sender.title(for: .normal) ?? ""
defer {
delegate?.dialpadViewControllerDidTapDigit?(self, digit: digit)
}
if !configuration.editingEnabled {
phoneNumber += digit
return