I've encountered a memory leak issue when setting the prefersGrabberVisible
to true
as shown below. There seems to be a bug where the view controller is not properly released from memory upon dismissal.
if let sheet = presentedViewController.sheetPresentationController {
sheet.detents = g_detents(defaultHeight: defaultHeight)
sheet.prefersScrollingExpandsWhenScrolledToEdge = false
sheet.prefersEdgeAttachedInCompactHeight = true
sheet.widthFollowsPreferredContentSizeWhenEdgeAttached = true
sheet.prefersGrabberVisible = true // Commenting out this line prevents the memory leak
sheet.selectedDetentIdentifier = .medium
}
present(presentedViewController, animated: true, completion: nil)
Has anyone else experienced this issue, or does anyone have a workaround for this memory leak problem? Any insights or suggestions would be greatly appreciated.