Skip to content

Commit a3b747d

Browse files
committed
🐛 [kmp/ios] 修复手势返回组件下标溢出的问题
1 parent c0f3061 commit a3b747d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

next/kmp/app/iosApp/DwebBrowser/DwebBrowser/Desktop/EdgeAnimationView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ class EdgeAnimationView: UIView {
6666
super.layoutSubviews()
6767
// 更新layer的路径
6868
var indexWidth = Int(self.frame.width)
69+
if indexWidth == 0 {
70+
return
71+
}
6972
if indexWidth >= cachedPaths.count{
7073
indexWidth = cachedPaths.count-1
7174
}
@@ -130,7 +133,7 @@ class EdgeAnimationView: UIView {
130133

131134
// 确保动画完成后才释放
132135
animator?.addCompletion { position in
133-
if position == .end {
136+
if position == .end && self.animator == animator {
134137
self.animator = nil
135138
}
136139
}

0 commit comments

Comments
 (0)