Hello,
It appears that there is a memory leak when utilizing a UISheetPresentationController. Please take a look at this simple project available here.
On the iOS 16.4 simulator for iPhone 14, if I dismiss the sheet, SheetViewController is successfully deinitialized. However, when I run this code on a real device (iPhone XR, iOS 16.4.1), the deinit of SheetViewController is not triggered. It seems like the presentation controller which holds a reference to SheetViewController stays in memory, captured by a closure.
Here is the memory leak caused by iOS:
Is this bug already known to the community? Should I report it? Is there any workaround for this issue?
Thank you.