Last active
December 1, 2021 19:53
-
-
Save barisuyar/b90ccf7e77e7c1210bb0cf02a845fa0d to your computer and use it in GitHub Desktop.
Slider + disabling actions
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
| @objc private func valueChanged(_ sender: Slider) { | |
| // Step 9 | |
| CATransaction.begin() | |
| CATransaction.setDisableActions(true) | |
| let thumbRectA = thumbRect(forBounds: bounds, | |
| trackRect: trackRect(forBounds: bounds), | |
| value: value) | |
| trackLayer.frame = .init(x: 0, | |
| y: frame.height / 4, | |
| width: thumbRectA.midX, | |
| height: frame.height / 2) | |
| // Step 9 | |
| CATransaction.commit() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment