Post

Replies

Boosts

Views

Activity

Critical Alerts - Do critical alert sounds play one at a time, or can two overlap?
I'm using UNNotificationSound.criticalSoundNamed with the Critical Alerts entitlement. I have two separate alarms that can each be active at the same time, each scheduling its own local notification on a repeating timer. Before switching to critical alerts, I played these with two AVAudioPlayer instances, and they overlapped fine. Now, using critical alert notifications instead, only one sound plays at a time — even when both are triggered around the same time. Is this expected? Does iOS only ever play one critical alert sound at a time per app (or system-wide), or is there a way to get two to play simultaneously?
1
0
280
3w
How to correctly use Accessibility Identifiers for Rows of Elements
So I have a simple view for my SwiftUI application below: import SwiftUI struct ContentView: View { var body: some View { List { ForEach(0..<4) { index in RowView(index: index) .accessibilityIdentifier("row") } } } } struct RowView: View { let index: Int var body: some View { HStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") Spacer() ButtonView(index: index) } .padding() } } struct ButtonView: View { let index: Int var body: some View { VStack { if index != 3 { Button(action: {}, label: { Text("Cancel") }) .accessibilityIdentifier("cancel_button") } Button(action: {}, label: { Text("Submit") }) .accessibilityIdentifier("submit_button") } } } My goal is to reference each cancel and submit button per row for a UI Test, which I have tried doing so here: let rowElements = app.tables.cells.matching(identifier: "row") for i in 0..<rowElements.count { let cancelButton = rowElements.element(boundBy: i).buttons["cancel_button"] let submitButton = rowElements.element(boundBy: i).buttons["submit_button"] XCTAssertTrue(cancelButton.exists, "Cancel button does not exist in row \(i)") XCTAssertTrue(submitButton.exists, "Submit button does not exist in row \(i)") } Even with the identifiers set like this my tests fail and say it cannot find the buttons labeled as they are with their specific identifiers or the rows. What is the correct way to reference elements if they are in a list or table for UI Testing? I'm specifically trying to use accessibility Identifiers to make my life easy.
2
0
1.8k
May ’24
Critical Alerts - Do critical alert sounds play one at a time, or can two overlap?
I'm using UNNotificationSound.criticalSoundNamed with the Critical Alerts entitlement. I have two separate alarms that can each be active at the same time, each scheduling its own local notification on a repeating timer. Before switching to critical alerts, I played these with two AVAudioPlayer instances, and they overlapped fine. Now, using critical alert notifications instead, only one sound plays at a time — even when both are triggered around the same time. Is this expected? Does iOS only ever play one critical alert sound at a time per app (or system-wide), or is there a way to get two to play simultaneously?
Replies
1
Boosts
0
Views
280
Activity
3w
How to correctly use Accessibility Identifiers for Rows of Elements
So I have a simple view for my SwiftUI application below: import SwiftUI struct ContentView: View { var body: some View { List { ForEach(0..<4) { index in RowView(index: index) .accessibilityIdentifier("row") } } } } struct RowView: View { let index: Int var body: some View { HStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") Spacer() ButtonView(index: index) } .padding() } } struct ButtonView: View { let index: Int var body: some View { VStack { if index != 3 { Button(action: {}, label: { Text("Cancel") }) .accessibilityIdentifier("cancel_button") } Button(action: {}, label: { Text("Submit") }) .accessibilityIdentifier("submit_button") } } } My goal is to reference each cancel and submit button per row for a UI Test, which I have tried doing so here: let rowElements = app.tables.cells.matching(identifier: "row") for i in 0..<rowElements.count { let cancelButton = rowElements.element(boundBy: i).buttons["cancel_button"] let submitButton = rowElements.element(boundBy: i).buttons["submit_button"] XCTAssertTrue(cancelButton.exists, "Cancel button does not exist in row \(i)") XCTAssertTrue(submitButton.exists, "Submit button does not exist in row \(i)") } Even with the identifiers set like this my tests fail and say it cannot find the buttons labeled as they are with their specific identifiers or the rows. What is the correct way to reference elements if they are in a list or table for UI Testing? I'm specifically trying to use accessibility Identifiers to make my life easy.
Replies
2
Boosts
0
Views
1.8k
Activity
May ’24