You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a tableview with several items on whcih each it has an udpate button.When clicked it shows the alert, receive user inputs and reload data of the tableview. The next time I click in the update button, the alert showsup but with no interaction meaninig I can't click in the edittext nor the cancel button. and if clicked outside the alert it keeps showing multiple alerts.
Observable
.zip(tableView.rx.itemSelected, tableView.rx.modelSelected(CartProductSectionItem.self))
.bind { indexPath, model in
switch model {
case .cartItem(let viewModel) :
self.showAlert(with: viewModel.item)
default:
return
}
}.disposed(by:rx.disposeBag)
The Alert view config.
func showAlert(with item: CartItem){
let vm = viewModel as! ViewModel
let appearance = SCLAlertView.SCLAppearance(
kTitleFont: Configs.Font.regular(size: 14),
kTextFont: Configs.Font.regular(size: 14),
showCloseButton: true, showCircularIcon: false
)
let alertView = SCLAlertView(appearance: appearance)
let qty: String = {
if let qty = item.quantity{
return String(qty)
}
return R.string.localizable.cartActionUpdateQty.key.localized()
}()
let alertViewText = alertView.addTextField(R.string.localizable.cartActionUpdateQtyPrefill.key.localized())
alertViewText.keyboardType = .numberPad
alertViewText.text = qty
_ = alertView.addButton(R.string.localizable.commonActionUpdate.key.localized()) {
if var qtyValue = alertViewText.text {
if qtyValue.isEmpty{
qtyValue = "1"
}
alertViewText.text = qtyValue
vm.updateIemQty(with: item.id!, qty: qtyValue)
}
}
alertView.showEdit("", subTitle: R.string.localizable.cartActionUpdateQty.key.localized())
}
The text was updated successfully, but these errors were encountered:
I have a tableview with several items on whcih each it has an udpate button.When clicked it shows the alert, receive user inputs and reload data of the tableview. The next time I click in the update button, the alert showsup but with no interaction meaninig I can't click in the edittext nor the cancel button. and if clicked outside the alert it keeps showing multiple alerts.
The Alert view config.
The text was updated successfully, but these errors were encountered: