Closed dmitryd20 closed 11 months ago
When we made animation parameter optional we solved an issue when you really need to disable all animations. We found that UITableView.RowAnimation.none
is still animated change. So we added optional to resolve this issue. And also we added UIView.performWithoutAnimation
to completely disable any animations inside performBatchUpdates
call.
To resolve ambiguity you can simply use nil
instead of none
or concrete UITableView.RowAnimation.none
if you need potentially animated change.
It's better to use enum for animation parameter:
enum AnimateOption {
case animated(UITableView.RowAnimation)
case none // without animation
}
Such change is achievable only in 8.0, because its not backward compatible. We will think about it.
Modifier
protocol has various methods with optionalAnimation
parameters. In its implementationsAnimation
becomes eitherUITableView.RowAnimation
orCollectionItemAnimation
.The problem appears when using UITableView modifiers with animation parameter
.none
..none
can be treated both asOptional.none
andUITableView.RowAnimation.none
. Following IDE warning:Even without ambiguity – it is not clear what should users choose if they need no animation -
nil
or.none
.Since
UITableView.RowAnimation
already has.none
case, is it possible to makeanimation
parameter non-optional? In UIColectionView modifiers it can still be optional.