iOS 17 beta 1 - 5 | Increasing layer speed prevents modal and some animation callbacks from getting called

When using Xcode 15 beta 6 / iOS 17 beta 5, it appears modal presentation and dismissal callbacks are sometimes not getting called. This is noticeable in our test suite where we artificially speed up animations via setting a high window layer speed (window.layer.speed = 100).

Example:

// Test results:
// - Xcode15 beta 1-6: ❌ fails
// - Xcode14.3.1: ✅ passes
func test_modalPresentation_withFastAnimations() throws {
    // Given
    let root = try findActiveWindowRootViewController()
    
    let presentation = expectation(description: "Modal Presented")
    let dismissal = expectation(description: "Modal Dismissed")
    let modal = UIViewController()
    
    // When
    
    // ----
    // updating layer speed on iOS 17.0 beta results
    // in presentation / dismissal callbacks getting omitted
    // subsequently failing tests due to unfulfilled expectations
    root.view.window?.layer.speed = 100
    // ----
    root.present(modal, animated: true) {
        presentation.fulfill()
        
        modal.dismiss(animated: true) {
            dismissal.fulfill()
        }
    }
    
    // Then
    wait(for: [presentation, dismissal], timeout: 4.0)
}

Context:

We have a large number of UI tests and resort to increasing the layer speed to speed up the test runtime.

Additional Notes:

  • This seems to not affect .fullScreen modal presentation styles
  • Similar issues were noticed with some animation callbacks getting omitted
  • This has been noticed since Xcode 15 / iOS 17 beta 1
  • Feedback + sample project FB12362774

Is this an issue or expected behaviour going forward?

Thanks!

iOS 17 beta 1 - 5 | Increasing layer speed prevents modal and some animation callbacks from getting called
 
 
Q