Skip to content

Commit f51d1a3

Browse files
authored
Merge pull request qunten#55 from daviyang35/patch-2
消除三目运算符歧义,便于理解
2 parents 80c7158 + 2efdf53 commit f51d1a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

8-显式动画/显式动画.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ self.colorLayer.backgroundColor = color.CGColor;
120120
{
121121

122122
//set the from value (using presentation layer if available)
123-
animation.fromValue = [layer.presentationLayer ?: layer valueForKeyPath:animation.keyPath];
123+
animation.fromValue = [(layer.presentationLayer ? layer.presentationLayer : layer) valueForKeyPath:animation.keyPath];
124124
//update the property in advance
125125
//note: this approach will only work if toValue != nil
126126
[CATransaction begin];

0 commit comments

Comments
 (0)