Skip to content

Commit

Permalink
fix(GiniBankSDK): Add isExclusiveTouch = true to all buttons and an…
Browse files Browse the repository at this point in the history
…y other view that behaves like a button

- by setting `isExclusiveTouch` to `true`, we ensure that only one touch event is recognized at a time on that particular UI element

PP-422
  • Loading branch information
ValentinaIancu-Gini committed Apr 24, 2024
1 parent 1e1eb1f commit dd2dadb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class DigitalLineItemTableViewCell: UITableViewCell {
let editTitle = NSLocalizedStringPreferredGiniBankFormat("ginibank.digitalinvoice.lineitem.editbutton",
comment: "Edit")
editButton.setTitle(editTitle, for: .normal)
editButton.isExclusiveTouch = true

separatorView.backgroundColor = GiniColor(light: .GiniBank.light3, dark: .GiniBank.dark4).uiColor()
unitPriceLabel.textColor = .GiniBank.dark7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ final class QuantityView: UIView {
let button = UIButton()
button.setImage(prefferedImage(named: "quantity_minus_icon"), for: .normal)
button.addTarget(self, action: #selector(decreaseQuantity), for: .touchUpInside)
button.isExclusiveTouch = true
button.translatesAutoresizingMaskIntoConstraints = false
let descriptor = NSLocalizedStringPreferredGiniBankFormat("ginibank.digitalinvoice.edit.minus.button.accessibility",
comment: "Decrease quantity")
Expand All @@ -56,6 +57,7 @@ final class QuantityView: UIView {
let button = UIButton()
button.setImage(prefferedImage(named: "quantity_plus_icon"), for: .normal)
button.addTarget(self, action: #selector(increaseQuantity), for: .touchUpInside)
button.isExclusiveTouch = true
button.translatesAutoresizingMaskIntoConstraints = false
let descriptor = NSLocalizedStringPreferredGiniBankFormat("ginibank.digitalinvoice.edit.plus.button.accessibility",
comment: "Increase quantity")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ final class EditLineItemView: UIView {
for: .normal)
button.setTitle(title, for: .normal)
button.addTarget(self, action: #selector(didTapCancel), for: .touchUpInside)
button.isExclusiveTouch = true
// The color is set twice because in some iOS versions the `setTitleColor` does not change the color
button.setTitleColor(.GiniBank.accent1, for: .normal)
button.titleLabel?.textColor = .GiniBank.accent1
Expand Down Expand Up @@ -47,6 +48,7 @@ final class EditLineItemView: UIView {
button.setAttributedTitle(NSAttributedString(string: title, attributes: textAttributes(for: .bodyBold)),
for: .normal)
button.addTarget(self, action: #selector(didTapSave), for: .touchUpInside)
button.isExclusiveTouch = true
// The color is set twice because in some iOS versions the `setTitleColor` does not change the color
button.setTitleColor(.GiniBank.accent1, for: .normal)
button.titleLabel?.textColor = .GiniBank.accent1
Expand Down

0 comments on commit dd2dadb

Please sign in to comment.