react-native-swipeable-actions 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/SwipeableView.swift +21 -0
- package/package.json +1 -1
package/ios/SwipeableView.swift
CHANGED
|
@@ -57,6 +57,10 @@ public class SwipeableView: ExpoView {
|
|
|
57
57
|
registryQueue.async(flags: .barrier) { _viewRegistry.removeValue(forKey: key) }
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
private static func clearOpenState(for key: String) {
|
|
61
|
+
registryQueue.async(flags: .barrier) { _openStateCache.removeValue(forKey: key) }
|
|
62
|
+
}
|
|
63
|
+
|
|
60
64
|
private static func getAllViews() -> [SwipeableView] {
|
|
61
65
|
registryQueue.sync { _viewRegistry.values.compactMap { $0.value } }
|
|
62
66
|
}
|
|
@@ -239,7 +243,24 @@ public class SwipeableView: ExpoView {
|
|
|
239
243
|
|
|
240
244
|
public override func willMove(toSuperview newSuperview: UIView?) {
|
|
241
245
|
if newSuperview == nil {
|
|
246
|
+
// Stop all timers and animations
|
|
242
247
|
stopProgressUpdates()
|
|
248
|
+
cancelAutoClose()
|
|
249
|
+
currentAnimator?.stopAnimation(true)
|
|
250
|
+
currentAnimator = nil
|
|
251
|
+
isAnimating = false
|
|
252
|
+
|
|
253
|
+
// Reset layer properties to prevent corruption
|
|
254
|
+
contentView?.transform = .identity
|
|
255
|
+
contentView?.layer.zPosition = 0
|
|
256
|
+
actionsView?.transform = .identity
|
|
257
|
+
actionsView?.layer.zPosition = 0
|
|
258
|
+
|
|
259
|
+
// Unregister from static registry and clear cached state
|
|
260
|
+
if let key = recyclingKey {
|
|
261
|
+
Self.unregisterView(for: key)
|
|
262
|
+
Self.clearOpenState(for: key)
|
|
263
|
+
}
|
|
243
264
|
}
|
|
244
265
|
super.willMove(toSuperview: newSuperview)
|
|
245
266
|
}
|
package/package.json
CHANGED