Closed hussnainahmaddd closed 1 year ago
I have the same issue :/
+1 Same issue
@Kn3cht Here is what I used to solve the issue for now.
You can use the configuration closure of the iPhoneNumberField to add a done button. I hope it helps! :)
iPhoneNumberField("(000) 000-0000",
text: viewStore.binding(\.$phoneNumber),
isEditing: $isEditingPhoneNumber,
configuration: { view in
func getDoneButton() -> UIToolbar {
let doneToolbar: UIToolbar = UIToolbar()
doneToolbar.barStyle = .default
let flexSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil)
let doneButton = UIButton(frame: .init(origin: .zero, size: .init(width: 28, height: 78)))
doneButton.heightAnchor.constraint(equalToConstant: 28).isActive = true
doneButton.widthAnchor.constraint(equalToConstant: 78).isActive = true
doneButton.layer.cornerRadius = 14
doneButton.setTitle("NEXT", for: .normal)
doneButton.backgroundColor = .systemBlue
doneButton.setTitleColor(.white, for: .normal)
doneButton.titleLabel?.font = .contentSemibold
doneButton.addAction(.init(handler: { _ in
isEditingPhoneNumber = false
setFocusField(.email)
}), for: .touchUpInside)
let done = UIBarButtonItem(customView: doneButton)
var items = [UIBarButtonItem]()
items.append(flexSpace)
items.append(done)
doneToolbar.items = items
doneToolbar.sizeToFit()
return doneToolbar
}
view.inputAccessoryView = getDoneButton()
})
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Hey i am currently using this package for my swiftui project and i can't access keyboardtype atribute plus i cannot done button as toolbar item to iphoneTextfield....
.keyboardType(.default) .submitLabel(.done)
i want to access these.Note: I am using package to use this library.