'Why isn't the toggleSidebar animation of NSSplitViewController animating child views?

I'm using a NSSplitViewController to layout my Mac app. The app has a sidebar, which is toggled in an animated fashion using the toggleSidebar method. The other, non-sidebar NSViewController displays a MTKView.

When the MTKView is the root view of its view controller, the animation works as expected, as below:

A window in macOS

However, when the MTKView is a child of the root view, the animation ceases to work properly. Rather than animating smoothly, the view snaps into place, as below:

A window in macOS

Is there a way to set my MTKView as a child of the root view and retain the smooth animation?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source