"Updating took more than 5 seconds" error when swiftui color scheme is different from system setting.

After updating my macbook to ventura, When changing the color scheme using the swiftui view modifier preferredColorScheme, If it is different from the system setting, an "Updating took more than 5 seconds" error occurs.

PreviewUpdateTimedOutError: Updating took more than 5 seconds



Updating a preview from  in ******.app (6003) took more than 5 seconds.

(I deleted the app name)

The current fix is to not use the preferredColorScheme method.

Does anyone have the same error as me?

If this is for the preview, try to build your app before. If there are errors in others part of code it may sometimes make preview take time to rebuild.

"Updating took more than 5 seconds" error when swiftui color scheme is different from system setting.
 
 
Q