Behavior Change in Dismissing View Controllers in Catalyst Apps on macOS 14.4 Betas

I wanted to post this here in the hope that this will draw attention to what I think is a serious change in behavior that could negatively affect Catalyst apps in macOS 14.4.

Prior to macOS 14.4, when the completion handler was invoked from calling dismiss() to dismiss a presented view controller in a Catalyst app, the dismissed controller no longer appeared in the chain. That is to say that if the root view controller presents View Controller A, when View Controller A is dismissed, the root view controller's presentedViewController property is nil when the completion handler for dismiss() is called.

With macOS 14.4, this is no longer the case. If the root view controller presents View Controller A and then View Controller A is dismissed, the presentedViewController property of the root view controller still refers to Controller A when dismiss()'s completion handler is called.

The side effect of this change in behavior means that if you try to present another view controller from the completion handler of the one being dismissed, it will fail to show because the top most view controller in the chain is the controller being dismissed and presenting from it will result in nothing showing up because it is removed from the chain immediately after the completion handler is invoked. Before macOS 14.4, it the top of the chain would have been the controller that presented the controller that was dismissed, which is what you actually want.

This problem does not exist in the betas for iOS 17.4 or iPadOS 17.4. It appears to affect only Catalyst apps running under macOS 1.4.4.

I think this change in behavior has the potential to affect a number existing Catalyst apps and it may not be obvious to the user something is going wrong. It really should be fixed before macOS 14.4 is released to the public.

I've created a feedback with a sample Xcode project that demonstrates the problem (feedback number FB13622757).

Answered by Enderlyn in 781285022

This seems to have been fixed in macOS 14.4 Beta 5.

This problem still exists in Beta 4 of macOS 14.4.

Update: It appears Apple is working on a fix. Fingers crossed it makes it in for the release version of macOS 14.4.

Accepted Answer

This seems to have been fixed in macOS 14.4 Beta 5.

Behavior Change in Dismissing View Controllers in Catalyst Apps on macOS 14.4 Betas
 
 
Q