Input node improvements

This commit is contained in:
Ali
2022-06-28 22:54:05 +02:00
parent 575605f4d0
commit 131be5aaab
51 changed files with 2586 additions and 1363 deletions

View File

@@ -10,8 +10,8 @@ public extension Transition.Animation.Curve {
self = .easeInOut
case .easeInOut:
self = .easeInOut
case .custom:
self = .spring
case let .custom(a, b, c, d):
self = .custom(a, b, c, d)
case .customSpring:
self = .spring
case .spring:
@@ -21,10 +21,12 @@ public extension Transition.Animation.Curve {
var containedViewLayoutTransitionCurve: ContainedViewLayoutTransitionCurve {
switch self {
case .easeInOut:
return .easeInOut
case .spring:
return .spring
case .easeInOut:
return .easeInOut
case .spring:
return .spring
case let .custom(a, b, c, d):
return .custom(a, b, c, d)
}
}
}
@@ -47,4 +49,4 @@ public extension Transition {
return .animated(duration: duration, curve: curve.containedViewLayoutTransitionCurve)
}
}
}
}

View File

@@ -532,14 +532,13 @@ public final class PagerComponent<ChildEnvironmentType: Equatable>: Component {
}
var removedIds: [AnyHashable] = []
for (id, contentView) in self.contentViews {
for (id, _) in self.contentViews {
if !validIds.contains(id) {
removedIds.append(id)
contentView.view.removeFromSuperview()
}
}
for id in removedIds {
self.contentViews.removeValue(forKey: id)
self.contentViews.removeValue(forKey: id)?.view.removeFromSuperview()
}
if let panelStateUpdated = component.panelStateUpdated {