Last active
December 7, 2018 18:32
-
-
Save vialyx/fd9ad7fb95ce82034f281d34dd18f1ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class AnimatableTableViewCell: UITableViewCell, HighlightAnimatable { | |
var settings: HighlightAnimatableSettings { | |
var settings = HighlightAnimatableSettings() | |
settings.transform = .init(scaleX: 0.70, y: 0.70) | |
settings.duration = 0.3 | |
return settings | |
} | |
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { | |
super.touchesBegan(touches, with: event) | |
highlight(true) | |
} | |
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { | |
super.touchesEnded(touches, with: event) | |
highlight(false) | |
} | |
override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) { | |
super.touchesCancelled(touches, with: event) | |
highlight(false) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment