@Stammy I had forgotten to update this post in reaction to a labs sessions at WWDC.
The issue I was describing (and that's more detailed in the thread I linked to) was apparently a VoiceOver bug that was causing the SIGABRT crash.
I was told this should've been fixed in iOS 15, but like you I'm stumbling upon this access issue, causing the app to be terminated.
Additionally they've offered some code for a quick workaround, I'll copy paste the code at the bottom.
I haven't tested it on XC 13 beta 2 and iOS 15 beta 2 yet, but I think it might be best to file a new bug report for this, since this seems to be a different issue. I'll be doing the same if the issue persists with the new betas and I'll probably mention the FB number of the previous issue, just in case it is related.
It might be a good idea to share FB number here if you file one yourself. Referring to FB numbers of similar reports tends to be helpful.
struct ContentView: View {
@State private var presenting = false
@State private var currentPage = 1
var body: some View {
Button("Tap to show page control") {
presenting = true
}
.sheet(isPresented: $presenting, content: {
ChildView {
PageControl(pageCount: 5, currentPage: $currentPage)
.background(Color.blue)
}
})
}
struct ChildView<Content: View>: View {
@ViewBuilder var content: Content
@State private var isVisible = false
@Environment(\.accessibilityEnabled) var accessibilityEnabled
var body: some View {
content
.environment(\.accessibilityEnabled, accessibilityEnabled && isVisible)
.onAppear {
isVisible = true
}
}
}
}