diff --git a/apps/mobile/native/ios/Modules/ItemPressable/ItemPressableModule.swift b/apps/mobile/native/ios/Modules/ItemPressable/ItemPressableModule.swift index bd778f6a6..b19d40829 100644 --- a/apps/mobile/native/ios/Modules/ItemPressable/ItemPressableModule.swift +++ b/apps/mobile/native/ios/Modules/ItemPressable/ItemPressableModule.swift @@ -39,22 +39,26 @@ class ItemPressableView: ExpoView { } func initizlize() { - gestureRecognizers = [UITapGestureRecognizer(target: self, action: #selector(handleTap))] + let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleTap)) + tapGesture.delegate = self + gestureRecognizers = [tapGesture] } @objc func handleTap() { let bgColor = layer.backgroundColor if touchHighlight { - UIView.animate(withDuration: 0.2, delay: 0, options: [.curveEaseIn]) { - self.layer.backgroundColor = UIColor.systemFill.cgColor - } completion: { done in - if done { - UIView.animate(withDuration: 0.2, delay: 0.2, options: [.curveEaseOut]) { - self.layer.backgroundColor = bgColor - } - } + layer.backgroundColor = UIColor.systemGray5.cgColor + + UIView.animate(withDuration: 0.2, delay: 0.5, options: [.curveEaseOut]) { + self.layer.backgroundColor = bgColor } } onItemPress() } } + +extension ItemPressableView: UIGestureRecognizerDelegate { + func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { + return touch.view == gestureRecognizer.view + } +}