Skip to content

Commit b7ff0b0

Browse files
authored
chore: Upgrade build Xcode version to 26.2 (#1522)
* chore: Upgrade build Xcode version to 26.2 * fix: iOS 26 sheet height inconsistency * chore: Upgrade ViewInspector * test: Fix broken tests
1 parent a08dda8 commit b7ff0b0

File tree

7 files changed

+61
-50
lines changed

7 files changed

+61
-50
lines changed

.github/actions/setup/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ runs:
125125
if: steps.settings.outputs.xcode == 'true'
126126
shell: bash
127127
run: |
128-
sudo xcode-select --switch /Applications/Xcode_16.4.app/Contents/Developer
128+
sudo xcode-select --switch /Applications/Xcode_26.2.app/Contents/Developer
129129
- name: Generate Xcode project
130130
if: steps.settings.outputs.xcode == 'true'
131131
shell: bash

fastlane/Fastfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ platform :ios do
214214
run_tests(
215215
workspace: 'iosApp/iosApp.xcworkspace',
216216
scheme: 'Staging',
217-
device: 'iPhone 16 (18.5)',
217+
device: 'iPhone 16 (26.2)',
218218
testplan: 'iosAppRetries',
219219
output_directory: options[:output_directory],
220220
include_simulator_logs: true,

iosApp/iosApp.xcworkspace/xcshareddata/swiftpm/Package.resolved

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

iosApp/iosApp/ContentView.swift

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ struct ContentView: View {
5252
}
5353

5454
var body: some View {
55-
GeometryReader { proxy in
56-
VStack {
57-
contents
58-
}
59-
.onAppear { contentHeight = proxy.size.height }
60-
.onChange(of: proxy.size.height) { contentHeight = $0 }
55+
VStack {
56+
contents
57+
}
58+
.onGeometryChange(for: CGFloat.self) { proxy in
59+
proxy.frame(in: .global).height
60+
} action: { height in
61+
contentHeight = height
6162
}
6263
.onReceive(inspection.notice) { inspection.visit(self, $0) }
6364
.onAppear {
@@ -336,8 +337,8 @@ struct ContentView: View {
336337
)
337338
.toolbar(.hidden, for: .tabBar)
338339
}
339-
// Set id per trip so that transitioning from one trip to another is handled by removing
340-
// the existing trip view & creating a new one
340+
// Set id per trip so that transitioning from one trip to another is handled
341+
// by removing the existing trip view & creating a new one
341342
.id(filter.tripId)
342343
.transition(transition)
343344
.animation(.easeOut, value: filter.tripId)
@@ -519,37 +520,38 @@ struct ContentView: View {
519520
&& contentVM.onboardingScreensPending != nil
520521
),
521522
content: {
522-
GeometryReader { proxy in
523-
VStack {
524-
navSheetContents
525-
.presentationDetents([.small, .medium, .almostFull], selection: $selectedDetent)
526-
.interactiveDismissDisabled()
527-
.modifier(AllowsBackgroundInteraction())
528-
}
529-
// within the sheet to prevent issues on iOS 16 with two modal views open at once
530-
.fullScreenCover(
531-
item: .constant(nav.coverItemIdentifiable()),
532-
onDismiss: {
533-
// Don't navigate back if hideMaps has been changed and the cover is being switched over
534-
if hideMaps { return }
535-
switch nearbyVM.navigationStack.last {
536-
case .alertDetails, .more, .saveFavorite: nearbyVM.goBack()
537-
default: break
538-
}
539-
},
540-
content: coverContents
541-
)
542-
.onChange(of: sheetRoute) { [oldSheetRoute = sheetRoute] newSheetRoute in
543-
if let oldSheetRoute,
544-
let newSheetRoute,
545-
SheetRoutes.companion.shouldResetSheetHeight(first: oldSheetRoute,
546-
second: newSheetRoute) {
547-
selectedDetent = .medium
523+
VStack {
524+
navSheetContents
525+
.presentationDetents([.small, .medium, .almostFull], selection: $selectedDetent)
526+
.interactiveDismissDisabled()
527+
.modifier(AllowsBackgroundInteraction())
528+
}
529+
// within the sheet to prevent issues on iOS 16 with two modal views open at once
530+
.fullScreenCover(
531+
item: .constant(nav.coverItemIdentifiable()),
532+
onDismiss: {
533+
// Don't navigate back if hideMaps has been changed and the cover is being switched over
534+
if hideMaps { return }
535+
switch nearbyVM.navigationStack.last {
536+
case .alertDetails, .more, .saveFavorite: nearbyVM.goBack()
537+
default: break
548538
}
549-
errorBannerVM.setSheetRoute(sheetRoute: newSheetRoute)
539+
},
540+
content: coverContents
541+
)
542+
.onChange(of: sheetRoute) { [oldSheetRoute = sheetRoute] newSheetRoute in
543+
if let oldSheetRoute,
544+
let newSheetRoute,
545+
SheetRoutes.companion.shouldResetSheetHeight(first: oldSheetRoute,
546+
second: newSheetRoute) {
547+
selectedDetent = .medium
550548
}
551-
.onAppear { recordSheetHeight(proxy.size.height) }
552-
.onChange(of: proxy.size.height) { newValue in recordSheetHeight(newValue) }
549+
errorBannerVM.setSheetRoute(sheetRoute: newSheetRoute)
550+
}
551+
.onGeometryChange(for: CGFloat.self) { proxy in
552+
proxy.frame(in: .global).height
553+
} action: { height in
554+
recordSheetHeight(height)
553555
}
554556
}
555557
)
@@ -682,7 +684,13 @@ struct ContentView: View {
682684
Only update this if we're less than half way up the users screen. Otherwise,
683685
the entire map is blocked by the sheet anyway, so it doesn't need to respond to height changes
684686
*/
685-
guard newSheetHeight < ((contentHeight - 8) * PresentationDetent.mediumDetentFraction) else { return }
687+
688+
let mediumSheetHeight = if #available(iOS 26, *) {
689+
(contentHeight * PresentationDetent.mediumDetentFraction) - 17
690+
} else {
691+
(contentHeight * PresentationDetent.mediumDetentFraction) - 5
692+
}
693+
guard newSheetHeight < mediumSheetHeight else { return }
686694
sheetHeight = newSheetHeight
687695
}
688696

iosApp/iosApp/Pages/Map/AnnotatedMap.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ struct AnnotatedMap: View {
6363
self.viewportProvider = viewportProvider
6464
}
6565

66+
var bottomSheetInsetPadding: CGFloat {
67+
if #available(iOS 26, *) { 4.0 } else { 0.0 }
68+
}
69+
6670
var body: some View {
6771
map
6872
.gestureOptions(.init(
@@ -89,8 +93,7 @@ struct AnnotatedMap: View {
8993
handleStyleLoaded()
9094
}
9195
}
92-
93-
.additionalSafeAreaInsets(.bottom, sheetHeight)
96+
.additionalSafeAreaInsets(.bottom, sheetHeight + bottomSheetInsetPadding)
9497
.additionalSafeAreaInsets(.top, 20)
9598
.ignoresSafeArea(.all)
9699
.onChange(of: showPuck) { _ in handleStyleLoaded() }

iosApp/iosAppTests/Views/ContentViewTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class ContentViewTests: XCTestCase {
3535

3636
ViewHosting.host(view: sut)
3737

38-
try sut.inspect().find(ContentView.self).find(ViewType.GeometryReader.self)
38+
try sut.inspect().find(ContentView.self).find(ViewType.VStack.self)
3939
.callOnChange(newValue: ScenePhase.background)
4040
wait(for: [disconnectedExpectation], timeout: 5)
4141
}
@@ -54,10 +54,10 @@ final class ContentViewTests: XCTestCase {
5454

5555
ViewHosting.host(view: sut)
5656

57-
try sut.inspect().find(ContentView.self).find(ViewType.GeometryReader.self)
57+
try sut.inspect().find(ContentView.self).find(ViewType.VStack.self)
5858
.callOnChange(newValue: ScenePhase.background)
5959
wait(for: [disconnectedExpectation], timeout: 1)
60-
try sut.inspect().find(ContentView.self).find(ViewType.GeometryReader.self)
60+
try sut.inspect().find(ContentView.self).find(ViewType.VStack.self)
6161
.callOnChange(newValue: ScenePhase.active)
6262
wait(for: [connectedExpectation], timeout: 1)
6363
}
@@ -80,7 +80,7 @@ final class ContentViewTests: XCTestCase {
8080

8181
ViewHosting.host(view: sut)
8282

83-
try sut.inspect().find(ContentView.self).find(ViewType.GeometryReader.self)
83+
try sut.inspect().find(ContentView.self).find(ViewType.VStack.self)
8484
.callOnChange(newValue: ScenePhase.active)
8585
wait(for: [joinAlertsExp], timeout: 5)
8686
}
@@ -99,7 +99,7 @@ final class ContentViewTests: XCTestCase {
9999

100100
ViewHosting.host(view: sut)
101101

102-
try sut.inspect().find(ContentView.self).find(ViewType.GeometryReader.self)
102+
try sut.inspect().find(ContentView.self).find(ViewType.VStack.self)
103103
.callOnChange(newValue: ScenePhase.background)
104104
wait(for: [leavesAlertsExp], timeout: 5)
105105
}

iosApp/project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ packages:
9797
from: 1.5.1
9898
ViewInspector:
9999
url: https://github.com/nalexn/ViewInspector
100-
from: 0.10.2
100+
from: 0.10.3
101101
targets:
102102
iosApp:
103103
type: application

0 commit comments

Comments
 (0)