@@ -16,6 +16,8 @@ public struct TransformAnimator: Animator {
1616 public var cascade : Bool
1717 /// A Boolean value that determines whether to show the initial insertion animation when the view is first loaded.
1818 public var showInitialInsertionAnimation : Bool = false
19+ /// A Boolean value that determines whether to show insertion animations for items that are out of the bounds of the hosting view.
20+ public var showInsertionAnimationOnOutOfBoundsItems : Bool = false
1921
2022 /// Initializes a new animator with the specified transform, duration, and cascade options.
2123 /// - Parameters:
@@ -26,12 +28,14 @@ public struct TransformAnimator: Animator {
2628 transform: CATransform3D = CATransform3DIdentity,
2729 duration: TimeInterval = 0.5 ,
2830 cascade: Bool = false ,
29- showInitialInsertionAnimation: Bool = false
31+ showInitialInsertionAnimation: Bool = false ,
32+ showInsertionAnimationOnOutOfBoundsItems: Bool = false ,
3033 ) {
3134 self . transform = transform
3235 self . duration = duration
3336 self . cascade = cascade
3437 self . showInitialInsertionAnimation = showInitialInsertionAnimation
38+ self . showInsertionAnimationOnOutOfBoundsItems = showInsertionAnimationOnOutOfBoundsItems
3539 }
3640
3741 public func delete( hostingView: UIView , view: UIView , completion: @escaping ( ) -> Void ) {
@@ -64,7 +68,7 @@ public struct TransformAnimator: Animator {
6468 view. bounds. size = frame. size
6569 view. center = frame. center
6670 let baseTransform = view. layer. transform
67- if hostingView. componentEngine. isReloading, showInitialInsertionAnimation || hostingView. componentEngine. hasReloaded, hostingView. bounds. intersects ( frame) {
71+ if hostingView. componentEngine. isReloading, showInitialInsertionAnimation || hostingView. componentEngine. hasReloaded, showInsertionAnimationOnOutOfBoundsItems || hostingView. bounds. intersects ( frame) {
6872 let offsetTime : TimeInterval = cascade ? TimeInterval ( frame. origin. distance ( hostingView. bounds. origin) / 3000 ) : 0
6973 UIView . performWithoutAnimation {
7074 view. layer. transform = transform
0 commit comments