Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
Fix previous commit affecting implicit animations on CALayer.
Browse files Browse the repository at this point in the history
Summary: Also remove the temporary code in ArcMove that was disabling actions.

Reviewers: O2 Material Motion, O4 Material Apple platform reviewers, #material_motion, chuga

Reviewed By: O4 Material Apple platform reviewers, chuga

Tags: #material_motion

Differential Revision: http://codereview.cc/D2798
  • Loading branch information
jverkoey committed Feb 24, 2017
1 parent a8c9ed5 commit a7bbbbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions examples/ArcMoveExample.swift
Expand Up @@ -47,13 +47,7 @@ public class ArcMoveExampleViewController: UIViewController {
draggable.targetView = targetView
runtime.add(draggable, to: targetView)

// Note: this is a temporary solution to prevent implicit animations
let tapLayerPositionWrapper = ReactiveProperty(initialValue: tapCircleLayer.position, externalWrite: { position in
CATransaction.setDisableActions(true)
reactiveTapLayer.position.value = position
CATransaction.setDisableActions(false)
}, coreAnimation: {_ in })
runtime.add(Tap(), to: tapLayerPositionWrapper)
runtime.add(Tap(), to: reactiveTapLayer.position)

let arcMove = ArcMove(duration: 0.4,
from: reactiveTapLayer.position,
Expand Down
2 changes: 1 addition & 1 deletion src/reactivetypes/ReactiveCALayer.swift
Expand Up @@ -117,7 +117,7 @@ public class ReactiveCALayer {
var lastAnimationKey: String?
let property = ReactiveProperty(name, initialValue: initialValue, externalWrite: { value in
let actionsWereDisabled = CATransaction.disableActions()
CATransaction.setDisableActions(false)
CATransaction.setDisableActions(true)
externalWrite(value)
CATransaction.setDisableActions(actionsWereDisabled)
}, coreAnimation: { [weak self] event in
Expand Down

0 comments on commit a7bbbbb

Please sign in to comment.