@@ -153,6 +153,7 @@ fileprivate extension UITableView {
153
153
154
154
fileprivate extension UITableView {
155
155
156
+ // Fix this one
156
157
func animateTableCellsWithDirection( duration: TimeInterval , direction: TableViewAnimation . Cell . AnimationDirection , indexPaths: [ IndexPath ] ? , completion: ( ( ) -> Void ) ? = nil ) {
157
158
158
159
let visibleCells : [ UITableViewCell ]
@@ -173,12 +174,16 @@ fileprivate extension UITableView {
173
174
174
175
UIView . animate ( withDuration: duration, delay: delay, usingSpringWithDamping: damping, initialSpringVelocity: 0.0 , options: . curveEaseInOut, animations: {
175
176
cell. layer. setAffineTransform ( . identity)
176
- } , completion: { finished in
177
- completion ? ( )
178
- } )
177
+ } , completion: nil )
178
+ }
179
+
180
+ let completionDelay : Int = Int ( ( 2 * duration) * 1000 )
181
+ DispatchQueue . main. asyncAfter ( deadline: . now( ) + . milliseconds( completionDelay) ) {
182
+ completion ? ( )
179
183
}
180
184
}
181
185
186
+ // Fix this one
182
187
func animateTableCellsWithTransform( duration: TimeInterval , transform: CGAffineTransform , options: UIViewAnimationOptions = . curveEaseInOut, completion: ( ( ) -> Void ) ? = nil ) {
183
188
for (index, cell) in self . visibleCells. enumerated ( ) {
184
189
let delay : TimeInterval = duration/ Double( self . visibleCells. count) * Double( index)
@@ -188,9 +193,12 @@ fileprivate extension UITableView {
188
193
189
194
UIView . animate ( withDuration: duration, delay: delay, usingSpringWithDamping: damping, initialSpringVelocity: 0.0 , options: options, animations: {
190
195
cell. layer. setAffineTransform ( . identity)
191
- } , completion: { finished in
196
+ } , completion: nil )
197
+
198
+ let completionDelay : Int = Int ( ( 2 * duration) * 1000 )
199
+ DispatchQueue . main. asyncAfter ( deadline: . now( ) + . milliseconds( completionDelay) ) {
192
200
completion ? ( )
193
- } )
201
+ }
194
202
}
195
203
}
196
204
0 commit comments