 
 import UIKit
 
+struct AnimationState {
+    var performed: Bool = false
+    var restoration: CGAffineTransform = .identity
+}
+
 class TappableView: UIView {
 
     fileprivate var touchingDownInside: Bool = false
-    fileprivate var forceTouchDownInside: Bool = false
-    fileprivate var alreadyTapped: Bool = false
-
     fileprivate let dimmedView: UIView
-    fileprivate var previousTransform: CGAffineTransform = .identity
+    fileprivate var animationState = AnimationState()
     let contentView: UIView
     var tapped: (() -> Void)?
-    var forceTapped: (() -> Void)?
 
     convenience init() {
         self.init(frame: .zero)


    fileprivate func clearTouchDownInside() {
        touchingDownInside = false
        forceTouchDownInside = false
    }

    fileprivate func boundsContain(_ touches: Set<UITouch>) -> Bool {


    fileprivate func touchesUp(_ touches: Set<UITouch>? = nil) {
        undoTapAnimation()
        if touchingDownInside {
            tapped?()
        }
        clearTouchDownInside()
