From 44809628a8107cb0d474e8e58845f8f0d7b434f3 Mon Sep 17 00:00:00 2001 From: Chris Ballinger Date: Sun, 12 Apr 2026 18:16:46 -0400 Subject: [PATCH] Add iOS 26 Liquid Glass navigation bar support Adapt navigation bars and detail views for the iOS 26 Liquid Glass translucent chrome. On iOS 26+, nav bars use system transparency instead of custom opaque appearance theming. - Appearance: skip custom nav bar background on iOS 26, keep tint color - DetailHostingController: move nav bar setup to viewWillAppear, enable translucency - DetailView: hide nav bar background via toolbarBackgroundVisibility for glass effect - PageViewManager: preserve translucency on iOS 26 instead of forcing opaque Co-Authored-By: Claude Opus 4.6 (1M context) --- iBurn/Appearance.swift | 5 +++++ .../Controllers/DetailHostingController.swift | 14 +++++++++----- iBurn/Detail/Views/DetailView.swift | 12 ++++++++++++ iBurn/PageViewManager.swift | 6 +++++- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/iBurn/Appearance.swift b/iBurn/Appearance.swift index b5fed756..ab103214 100644 --- a/iBurn/Appearance.swift +++ b/iBurn/Appearance.swift @@ -190,6 +190,11 @@ extension Appearance { } @objc public static func applyNavigationBarAppearance(_ navBar: UINavigationBar, colors: BRCImageColors, animated: Bool) { + if #available(iOS 26, *) { + // iOS 26: let system Liquid Glass handle nav bar appearance + navBar.tintColor = colors.primaryColor + return + } let appearance = makeNavigationBarAppearance(colors: colors) let applyTheme = { navBar.standardAppearance = appearance diff --git a/iBurn/Detail/Controllers/DetailHostingController.swift b/iBurn/Detail/Controllers/DetailHostingController.swift index e8440605..45c31b81 100644 --- a/iBurn/Detail/Controllers/DetailHostingController.swift +++ b/iBurn/Detail/Controllers/DetailHostingController.swift @@ -73,11 +73,13 @@ class DetailHostingController: UIHostingController, DynamicViewContr override func viewDidLoad() { super.viewDidLoad() - - // Configure navigation bar appearance + } + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) setupNavigationBarAppearance() } - + override func viewWillLayoutSubviews() { super.viewWillLayoutSubviews() @@ -107,7 +109,9 @@ class DetailHostingController: UIHostingController, DynamicViewContr } private func setupNavigationBarAppearance() { - // This can be customized based on existing app theming - // For now, use default appearance + if #available(iOS 26, *) { + // Transparent nav bar for Liquid Glass effect + navigationController?.navigationBar.isTranslucent = true + } } } diff --git a/iBurn/Detail/Views/DetailView.swift b/iBurn/Detail/Views/DetailView.swift index d0fa2447..4f5e1fb6 100644 --- a/iBurn/Detail/Views/DetailView.swift +++ b/iBurn/Detail/Views/DetailView.swift @@ -55,6 +55,7 @@ struct DetailView: View { .background(backgroundColor) .navigationBarTitleDisplayMode(.inline) .navigationTitle(viewModel.title) + .modifier(TransparentNavBarModifier()) .sheet(isPresented: imageViewerBinding) { if let selected = viewModel.selectedImage { ImageViewerSheet(image: selected) @@ -786,6 +787,17 @@ struct DetailVisitStatusCell: View { } } +/// Hides the navigation bar background on iOS 26+ for Liquid Glass transparency. +private struct TransparentNavBarModifier: ViewModifier { + func body(content: Content) -> some View { + if #available(iOS 26, *) { + content.toolbarBackgroundVisibility(.hidden, for: .navigationBar) + } else { + content + } + } +} + struct DetailViewHistoryCell: View { let firstViewed: Date? let lastViewed: Date? diff --git a/iBurn/PageViewManager.swift b/iBurn/PageViewManager.swift index a8c7046e..b88d0188 100644 --- a/iBurn/PageViewManager.swift +++ b/iBurn/PageViewManager.swift @@ -45,7 +45,11 @@ import EventKitUI pageVC.delegate = self pageVC.dataSource = self - navBar?.isTranslucent = false + if #available(iOS 26, *) { + // Let iOS 26 Liquid Glass handle nav bar transparency + } else { + navBar?.isTranslucent = false + } navBar?.setColorTheme(colors, animated: false) pageVC.setViewControllers([detailVC], direction: .forward, animated: false, completion: nil) // Navigation item forwarding is now handled automatically by DetailPageViewController