fix(ios): ensure fallback system image

This commit is contained in:
Tienson Qin
2025-12-10 18:15:08 +08:00
parent 84df4ad93a
commit 3eb0846bba
2 changed files with 28 additions and 7 deletions

View File

@@ -39,11 +39,20 @@ public class LiquidTabsPlugin: CAPPlugin, CAPBridgedPlugin {
let tabs: [LiquidTab] = tabsArray.compactMap { dict in
guard
let id = dict["id"] as? String,
let title = dict["title"] as? String
let id = dict["id"] as? String,
let title = dict["title"] as? String
else { return nil }
let systemImage = dict["systemImage"] as? String ?? "square"
let rawSystemImage = dict["systemImage"] as? String ?? "square"
let systemImage: String = {
if UIImage(systemName: rawSystemImage) != nil {
return rawSystemImage
} else {
return "square"
}
}()
let roleStr = dict["role"] as? String ?? "normal"
let role: LiquidTab.Role = (roleStr == "search") ? .search : .normal

View File

@@ -122,7 +122,19 @@
(defn configure
[]
(configure-tabs
[{:id "home" :title "Home" :systemImage "house" :role "normal"}
{:id "graphs" :title "Graphs" :systemImage "app.background.dotted" :role "normal"}
{:id "capture" :title "Capture" :systemImage "tray" :role "normal"}
{:id "go to" :title "Go To" :systemImage "square.stack.3d.down.right" :role "normal"}]))
[{:id "home"
:title "Home"
:systemImage "house"
:role "normal"}
{:id "graphs"
:title "Graphs"
:systemImage "app.background.dotted"
:role "normal"}
{:id "capture"
:title "Capture"
:systemImage "tray"
:role "normal"}
{:id "go to"
:title "Go To"
:systemImage "square.stack.3d.down.right"
:role "normal"}]))