@@ -113,11 +113,19 @@ class UIKitBehavioralTests: XCTestCase {
113
113
114
114
func testSomePropertiesImplicitlyAnimateButNotAdditively( ) {
115
115
let baselineProperties : [ AnimatableKeyPath : Any ] = [
116
- . anchorPoint: CGPoint ( x: 0.2 , y: 0.4 ) ,
117
116
. backgroundColor: UIColor . blue,
118
117
. opacity: 0.5 ,
119
118
]
120
- for (keyPath, value) in baselineProperties {
119
+ let properties : [ AnimatableKeyPath : Any ]
120
+ if #available( iOS 11 . 0 , * ) {
121
+ // Anchor point became implicitly animatable in iOS 11.
122
+ var baselineWithCornerRadiusProperties = baselineProperties
123
+ baselineWithCornerRadiusProperties [ . anchorPoint] = CGPoint ( x: 0.2 , y: 0.4 )
124
+ properties = baselineWithCornerRadiusProperties
125
+ } else {
126
+ properties = baselineProperties
127
+ }
128
+ for (keyPath, value) in properties {
121
129
rebuildView ( )
122
130
123
131
UIView . animate ( withDuration: 0.01 ) {
@@ -139,6 +147,7 @@ class UIKitBehavioralTests: XCTestCase {
139
147
140
148
func testSomePropertiesDoNotImplicitlyAnimate( ) {
141
149
let baselineProperties : [ AnimatableKeyPath : Any ] = [
150
+ . anchorPoint: CGPoint ( x: 0.2 , y: 0.4 ) ,
142
151
. borderWidth: 5 ,
143
152
. borderColor: UIColor . red,
144
153
. cornerRadius: 3 ,
@@ -155,6 +164,7 @@ class UIKitBehavioralTests: XCTestCase {
155
164
if #available( iOS 11 . 0 , * ) {
156
165
// Corner radius became implicitly animatable in iOS 11.
157
166
var baselineWithOutCornerRadius = baselineProperties
167
+ baselineWithOutCornerRadius. removeValue ( forKey: . anchorPoint)
158
168
baselineWithOutCornerRadius. removeValue ( forKey: . cornerRadius)
159
169
properties = baselineWithOutCornerRadius
160
170
0 commit comments