@ajuarezso/capacitor-liquid-glass 0.3.2 → 0.3.4
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.
|
@@ -65,9 +65,11 @@ final class LiquidGlassTabBarOverlay: UIViewController {
|
|
|
65
65
|
|
|
66
66
|
override func viewDidLoad() {
|
|
67
67
|
super.viewDidLoad()
|
|
68
|
-
// Background transparente
|
|
69
|
-
//
|
|
70
|
-
// la
|
|
68
|
+
// Background transparente. El `self.view` está sizado SOLO al rect
|
|
69
|
+
// del tab bar (leading/trailing/bottom al rootVC, sin top — la
|
|
70
|
+
// altura la determina el intrinsic content size del UITabBar dentro).
|
|
71
|
+
// Por eso NO necesitamos `hitTest` override: el view en sí solo
|
|
72
|
+
// existe sobre el área de la pill, los taps fuera no llegan.
|
|
71
73
|
view.backgroundColor = .clear
|
|
72
74
|
|
|
73
75
|
tabBar.translatesAutoresizingMaskIntoConstraints = false
|
|
@@ -79,24 +81,16 @@ final class LiquidGlassTabBarOverlay: UIViewController {
|
|
|
79
81
|
|
|
80
82
|
view.addSubview(tabBar)
|
|
81
83
|
|
|
84
|
+
// UITabBar ocupa TODO el self.view — el view es del tamaño exacto
|
|
85
|
+
// de la pill gracias a las constraints del attach() (sin top).
|
|
82
86
|
NSLayoutConstraint.activate([
|
|
83
87
|
tabBar.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
|
84
88
|
tabBar.trailingAnchor.constraint(equalTo: view.trailingAnchor),
|
|
89
|
+
tabBar.topAnchor.constraint(equalTo: view.topAnchor),
|
|
85
90
|
tabBar.bottomAnchor.constraint(equalTo: view.bottomAnchor),
|
|
86
91
|
])
|
|
87
92
|
}
|
|
88
93
|
|
|
89
|
-
/// `self.view` cubre todo el rootVC (constraints leading/trailing/top/
|
|
90
|
-
/// bottom = rootVC.view). Sin este override absorbería TODOS los taps y
|
|
91
|
-
/// bloquearía el webview de Capacitor. Solo dejamos pasar los toques que
|
|
92
|
-
/// aterrizan sobre el `UITabBar` o sus subvistas.
|
|
93
|
-
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
|
94
|
-
let hit = super.hitTest(point, with: event)
|
|
95
|
-
guard let hit else { return nil }
|
|
96
|
-
if hit === tabBar || hit.isDescendant(of: tabBar) { return hit }
|
|
97
|
-
return nil
|
|
98
|
-
}
|
|
99
|
-
|
|
100
94
|
/// Adjunta este view controller como child del rootViewController del
|
|
101
95
|
/// window. Idempotente: si ya está adjuntado al mismo root, no-op.
|
|
102
96
|
func attach(to window: UIWindow) {
|
|
@@ -113,10 +107,14 @@ final class LiquidGlassTabBarOverlay: UIViewController {
|
|
|
113
107
|
rootVC.addChild(self)
|
|
114
108
|
self.view.translatesAutoresizingMaskIntoConstraints = false
|
|
115
109
|
rootVC.view.addSubview(self.view)
|
|
110
|
+
// SIN top constraint — la altura del view se deriva del intrinsic
|
|
111
|
+
// content size del UITabBar dentro (~50pt + safe-area-bottom).
|
|
112
|
+
// Replica del patrón stay-liquid (validado en producción) que
|
|
113
|
+
// permite a iOS 26 detectar este UITabBar como "floating tab bar"
|
|
114
|
+
// y aplicarle Liquid Glass automáticamente.
|
|
116
115
|
NSLayoutConstraint.activate([
|
|
117
116
|
self.view.leadingAnchor.constraint(equalTo: rootVC.view.leadingAnchor),
|
|
118
117
|
self.view.trailingAnchor.constraint(equalTo: rootVC.view.trailingAnchor),
|
|
119
|
-
self.view.topAnchor.constraint(equalTo: rootVC.view.topAnchor),
|
|
120
118
|
self.view.bottomAnchor.constraint(equalTo: rootVC.view.bottomAnchor),
|
|
121
119
|
])
|
|
122
120
|
self.didMove(toParent: rootVC)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ajuarezso/capacitor-liquid-glass",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "iOS 26 Liquid Glass native chrome (TabBar, NavigationBar, Alerts, Sheets) for Capacitor apps. Falls back gracefully on iOS < 26 and Android.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|