@craft-native/ios 0.0.390 → 0.0.392
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/package.json +1 -1
- package/templates/CraftHybrid.swift +16 -3
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import Foundation
|
|
2
2
|
import SwiftUI
|
|
3
3
|
import UIKit
|
|
4
|
+
|
|
5
|
+
/// Includes deceleration, which runs in default mode after tracking ends.
|
|
6
|
+
func craftHybridHasActiveScroll(in view: UIView) -> Bool {
|
|
7
|
+
if let scroll = view as? UIScrollView,
|
|
8
|
+
scroll.isTracking || scroll.isDragging || scroll.isDecelerating { return true }
|
|
9
|
+
return view.subviews.contains { craftHybridHasActiveScroll(in: $0) }
|
|
10
|
+
}
|
|
4
11
|
import WebKit
|
|
5
12
|
import Combine
|
|
6
13
|
|
|
@@ -1261,9 +1268,14 @@ final class CraftHybridController: UITabBarController, UITabBarControllerDelegat
|
|
|
1261
1268
|
item.accessibilityLabel = tab.accessibilityLabel ?? tab.displayTitle
|
|
1262
1269
|
}
|
|
1263
1270
|
if let committed = stacks[currentTab], controllers.contains(where: { $0 === committed }), selectedViewController !== committed {
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1271
|
+
// UIKit owns the Liquid Glass selection pill. Suppressing this
|
|
1272
|
+
// transaction made a completed page swipe snap its indicator.
|
|
1273
|
+
// Keep native selection animation and honour Reduce Motion.
|
|
1274
|
+
let duration = UIAccessibility.isReduceMotionEnabled ? 0 : 0.22
|
|
1275
|
+
UIView.animate(withDuration: duration, delay: 0,
|
|
1276
|
+
options: [.beginFromCurrentState, .allowUserInteraction]) {
|
|
1277
|
+
self.selectedViewController = committed
|
|
1278
|
+
self.tabBar.layoutIfNeeded()
|
|
1267
1279
|
}
|
|
1268
1280
|
}
|
|
1269
1281
|
tabBar.tintColor = chrome.tint ?? config.tintColor.flatMap { UIColor(hex: $0) } ?? view.tintColor
|
|
@@ -1950,6 +1962,7 @@ final class CraftHybridController: UITabBarController, UITabBarControllerDelegat
|
|
|
1950
1962
|
guard self.currentTab == owner, self.view.window != nil else { return }
|
|
1951
1963
|
let quietFor = neighbour ? 0.3 : 1.0
|
|
1952
1964
|
guard self.activeTabSwipeTarget == nil, !self.tabSwipeSettling,
|
|
1965
|
+
!craftHybridHasActiveScroll(in: self.view),
|
|
1953
1966
|
!self.stacks.values.contains(where: { $0.transitionCoordinator != nil }),
|
|
1954
1967
|
CACurrentMediaTime() - self.lastNavigation >= quietFor else {
|
|
1955
1968
|
self.prepareAdjacentNativeTabs()
|