Skip to content

Commit fa5d40c

Browse files
committed
Fix crash issue on iOS 18
1 parent 94e1d75 commit fa5d40c

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

Tests/OpenSwiftUICompatibilityTests/Integration/UIKit/UIHostingControllerTests.swift

+12
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ struct UIHostingControllerTests {
1616
)
1717
)
1818
func testBasicAnyView() throws {
19+
guard #unavailable(iOS 18) else {
20+
withKnownIssue {
21+
Issue.record("Known crash issue on iOS 18")
22+
}
23+
return
24+
}
1925
struct ContentView: View {
2026
var body: some View {
2127
AnyView(EmptyView())
@@ -34,6 +40,12 @@ struct UIHostingControllerTests {
3440
)
3541
)
3642
func testBasicAnyViewWithProperty() throws {
43+
guard #unavailable(iOS 18) else {
44+
withKnownIssue {
45+
Issue.record("Known crash issue on iOS 18")
46+
}
47+
return
48+
}
3749
struct ContentView: View {
3850
var name = ""
3951
var body: some View {

Tests/OpenSwiftUICompatibilityTests/View/Debug/ChangedBodyPropertyTests.swift

+18
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ struct ChangedBodyPropertyTests {
3535
#endif
3636
@Test
3737
func zeroPropertyView() throws {
38+
guard #unavailable(iOS 18) else {
39+
withKnownIssue {
40+
Issue.record("Known crash issue on iOS 18")
41+
}
42+
return
43+
}
3844
struct ContentView: View {
3945
var body: some View {
4046
let _ = Self._logChanges()
@@ -56,6 +62,12 @@ struct ChangedBodyPropertyTests {
5662
#endif
5763
@Test
5864
func propertyView() throws {
65+
guard #unavailable(iOS 18) else {
66+
withKnownIssue {
67+
Issue.record("Known crash issue on iOS 18")
68+
}
69+
return
70+
}
5971
struct ContentView: View {
6072
var name = ""
6173
var body: some View {
@@ -78,6 +90,12 @@ struct ChangedBodyPropertyTests {
7890
#endif
7991
@Test
8092
func statePropertyView() throws {
93+
guard #unavailable(iOS 18) else {
94+
withKnownIssue {
95+
Issue.record("Known crash issue on iOS 18")
96+
}
97+
return
98+
}
8199
struct ContentView: View {
82100
@State var name = ""
83101
var body: some View {

Tests/OpenSwiftUICompatibilityTests/View/Modifier/AppearanceActionModifierTests.swift

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ import Testing
88
struct AppearanceActionModifierTests {
99
@Test
1010
func appear() async throws {
11+
guard #unavailable(iOS 18) else {
12+
withKnownIssue {
13+
Issue.record("Known crash issue on iOS 18")
14+
}
15+
return
16+
}
1117
struct ContentView: View {
1218
var confirmation: Confirmation
1319

Tests/OpenSwiftUITests/Core/Semantics/SemanticFeatureTests.swift

+12-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@
55
@testable import OpenSwiftUI
66
import Testing
77

8-
struct SemanticFeatureTests {
8+
@MainActor
9+
final class SemanticFeatureTests {
10+
private let originalValue: Semantics?
11+
12+
init() {
13+
originalValue = Semantics.forced
14+
}
15+
16+
deinit {
17+
Semantics.forced = originalValue
18+
}
19+
920
/// Represent a minimum version
1021
struct SemanticFeature1: SemanticFeature {
1122
static var introduced: Semantics { .init(value: 0x0000_0000) }

0 commit comments

Comments
 (0)