Created
April 17, 2018 17:03
-
-
Save usagimaru/f2a75286e2e7599a6b65a22e54a575eb to your computer and use it in GitHub Desktop.
Disable implicit animations of CAConstraintLayoutManager.
This file contains 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 Cocoa | |
class MyConstraintLayoutManager: CAConstraintLayoutManager { | |
var isImplicitAnimationsDisabled: Bool = true | |
override func layoutSublayers(of layer: CALayer) { | |
// サブレイヤーのレイアウト時の暗黙アニメーションを無効化 | |
CATransaction.begin() | |
CATransaction.setDisableActions(self.isImplicitAnimationsDisabled) | |
super.layoutSublayers(of: layer) | |
CATransaction.commit() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment