Skip to content

Instantly share code, notes, and snippets.

@usagimaru
Created April 17, 2018 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save usagimaru/f2a75286e2e7599a6b65a22e54a575eb to your computer and use it in GitHub Desktop.
Save usagimaru/f2a75286e2e7599a6b65a22e54a575eb to your computer and use it in GitHub Desktop.
Disable implicit animations of CAConstraintLayoutManager.
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