A glitch with retained view controllers on Catalyst

Hello!

I discovered a bug on Catalyst about a three years ago but it still seems to be not fixed. My bug report number is FB9705748.

The Internet is silent on this so I'm even not sure, perhaps it's only me.

So to the problem. When you display UICollectionViewController or UIViewController that contains UICollectionView, interact with the collection view then dismiss the view controller, the displayed view controller isn't released if dismissal is done through navigation bar item.

The problem occurs only when the run target is My Mac (Mac Catalyst). Everything is fine when you run on iOS or via My Mac (Designed for iPad).

The sample project is uploaded to GitHub. It has a video that shows this strange behavior, see the log for 'deinit' messages.

I did have some workaround to fix this but it stops to work, presumable on the new macOS. Also, chances are that it's not only UICollectionView which initiates the glitch, it's just that I only encounter it with collection views.

Reasons for my post.

  1. Could you, colleagues, confirm that this is a bug but not incorrect setup of mine?
  2. If it's a bug then to bring attention of Apple engineers to the problem. :)
A glitch with retained view controllers on Catalyst
 
 
Q