Skip to content

Commit 85671bb

Browse files
Merge pull request #246 from iBurnApp/liquid-glass-ui
2 parents 87bc08d + 4480962 commit 85671bb

4 files changed

Lines changed: 31 additions & 6 deletions

File tree

iBurn/Appearance.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ extension Appearance {
190190
}
191191

192192
@objc public static func applyNavigationBarAppearance(_ navBar: UINavigationBar, colors: BRCImageColors, animated: Bool) {
193+
if #available(iOS 26, *) {
194+
// iOS 26: let system Liquid Glass handle nav bar appearance
195+
navBar.tintColor = colors.primaryColor
196+
return
197+
}
193198
let appearance = makeNavigationBarAppearance(colors: colors)
194199
let applyTheme = {
195200
navBar.standardAppearance = appearance

iBurn/Detail/Controllers/DetailHostingController.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@ class DetailHostingController: UIHostingController<DetailView>, DynamicViewContr
7373

7474
override func viewDidLoad() {
7575
super.viewDidLoad()
76-
77-
// Configure navigation bar appearance
76+
}
77+
78+
override func viewWillAppear(_ animated: Bool) {
79+
super.viewWillAppear(animated)
7880
setupNavigationBarAppearance()
7981
}
80-
82+
8183
override func viewWillLayoutSubviews() {
8284
super.viewWillLayoutSubviews()
8385

@@ -107,7 +109,9 @@ class DetailHostingController: UIHostingController<DetailView>, DynamicViewContr
107109
}
108110

109111
private func setupNavigationBarAppearance() {
110-
// This can be customized based on existing app theming
111-
// For now, use default appearance
112+
if #available(iOS 26, *) {
113+
// Transparent nav bar for Liquid Glass effect
114+
navigationController?.navigationBar.isTranslucent = true
115+
}
112116
}
113117
}

iBurn/Detail/Views/DetailView.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ struct DetailView: View {
5555
.background(backgroundColor)
5656
.navigationBarTitleDisplayMode(.inline)
5757
.navigationTitle(viewModel.title)
58+
.modifier(TransparentNavBarModifier())
5859
.sheet(isPresented: imageViewerBinding) {
5960
if let selected = viewModel.selectedImage {
6061
ImageViewerSheet(image: selected)
@@ -786,6 +787,17 @@ struct DetailVisitStatusCell: View {
786787
}
787788
}
788789

790+
/// Hides the navigation bar background on iOS 26+ for Liquid Glass transparency.
791+
private struct TransparentNavBarModifier: ViewModifier {
792+
func body(content: Content) -> some View {
793+
if #available(iOS 26, *) {
794+
content.toolbarBackgroundVisibility(.hidden, for: .navigationBar)
795+
} else {
796+
content
797+
}
798+
}
799+
}
800+
789801
struct DetailViewHistoryCell: View {
790802
let firstViewed: Date?
791803
let lastViewed: Date?

iBurn/PageViewManager.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ import EventKitUI
4545

4646
pageVC.delegate = self
4747
pageVC.dataSource = self
48-
navBar?.isTranslucent = false
48+
if #available(iOS 26, *) {
49+
// Let iOS 26 Liquid Glass handle nav bar transparency
50+
} else {
51+
navBar?.isTranslucent = false
52+
}
4953
navBar?.setColorTheme(colors, animated: false)
5054
pageVC.setViewControllers([detailVC], direction: .forward, animated: false, completion: nil)
5155
// Navigation item forwarding is now handled automatically by DetailPageViewController

0 commit comments

Comments
 (0)