Skip to content

Commit 0acf582

Browse files
committed
minor macOS 26 UI updates
1 parent a4abed8 commit 0acf582

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

.github/workflows/swift.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313
build:
1414

15-
runs-on: macos-15
15+
runs-on: macos-latest
1616

1717
steps:
1818
- uses: maxim-lobanov/setup-xcode@v1

DIExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DIExample/Posts14/PostListView14.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ struct PostListView14: View {
4242
.navigationTitle("Posts14")
4343
.toolbar {
4444
ToolbarItem(placement: .automatic) {
45-
Text("\(viewModel.secondsSinceLastRefresh)")
45+
Text("\(viewModel.secondsSinceLastRefresh, format: .number)")
46+
.fontDesign(.monospaced)
4647
}
48+
.hideSharedBackgroundIfAvailable()
49+
4750
ToolbarItem(placement: .automatic) {
4851
Button {
4952
viewModel.refresh()
@@ -61,6 +64,16 @@ struct PostListView14: View {
6164
}
6265
}
6366

67+
extension ToolbarContent {
68+
@ToolbarContentBuilder func hideSharedBackgroundIfAvailable() -> some ToolbarContent {
69+
if #available(macOS 26.0, *) {
70+
sharedBackgroundVisibility(.hidden)
71+
} else {
72+
self
73+
}
74+
}
75+
}
76+
6477
#if DEBUG
6578
import Combine
6679
import Factory

0 commit comments

Comments
 (0)