@@ -55,14 +55,14 @@ class ViewController: UIViewController {
55
55
print ( self . v. center. y)
56
56
switch which {
57
57
case 1 :
58
- UIView . animate ( withDuration: 0.4 , animations : {
58
+ UIView . animate ( withDuration: 0.4 ) {
59
59
self . v. backgroundColor = UIColor . red ( )
60
- } )
60
+ }
61
61
case 2 :
62
- UIView . animate ( withDuration: 0.4 , animations : {
62
+ UIView . animate ( withDuration: 0.4 ) {
63
63
self . v. backgroundColor = UIColor . red ( )
64
64
self . v. center. y += 100
65
- } )
65
+ }
66
66
case 3 :
67
67
let v2 = UIView ( )
68
68
v2. backgroundColor = UIColor . black ( )
@@ -81,12 +81,12 @@ class ViewController: UIViewController {
81
81
_ in print ( self . v. superview)
82
82
}
83
83
case 5 :
84
- UIView . animate ( withDuration: 1 , animations : {
84
+ UIView . animate ( withDuration: 1 ) {
85
85
self . v. backgroundColor = UIColor . red ( )
86
86
UIView . performWithoutAnimation {
87
87
self . v. center. y += 100
88
88
}
89
- } )
89
+ }
90
90
case 6 :
91
91
func report( _ ix: Int ) {
92
92
let pres = ( self . v. layer. presentationLayer ( ) as! CALayer ) . position. y
@@ -129,13 +129,13 @@ class ViewController: UIViewController {
129
129
self . v. center. x = xorig
130
130
} )
131
131
case 11 :
132
- UIView . animate ( withDuration: 1 , animations : {
132
+ UIView . animate ( withDuration: 1 ) {
133
133
self . v. center. x += 100
134
- } )
134
+ }
135
135
// let opts = UIViewAnimationOptions.beginFromCurrentState
136
- UIView . animate ( withDuration: 1 , animations : {
136
+ UIView . animate ( withDuration: 1 ) {
137
137
self . v. center. y += 100
138
- } )
138
+ }
139
139
case 12 :
140
140
UIView . animate ( withDuration: 2 , animations: {
141
141
self . v. center. x += 100
0 commit comments