Closed grumpy-sw closed 1 year ago
Hi,
Dismiss action doesn't deallocate an instance of FloatingPanelController
object. It just hides the pane and removes the instance from the parent view controller. That's why you have to deallocate the instance. If you release it, if the content view controller has no references from other objects, the content view controller will be deallocated too.
The reason why the above design is because it's easy to reuse an instance of FloatingPanelController
object and its content view controller.
I understand it. Thanks a lot!
Description
Hi. I want to completely remove the FloatingPanelController's
contentViewController
when closing the panel using the existing implemented behavior. For example, when closing the panel through a customized button and setting the parent ViewController as a delegate, I could explicitly call the following code to remove the contentViewController:or
However, When closing the panel via implemented behavior(like
dismissalTapGestureRecognizer
), the panel simply disappears from the screen, and the contentViewController does not remove. It can be observed through Xcode's Memory Graph.In my expectation, the
BottomSheetViewController
should be deallocated from memory.Of course, to make it behave as I want, I can call the delegate method in
viewDidDisappear
. However, I'd like to know whether this is intentional, and whether explicitly setting contentViewController to nil, as in the above code, is considered an incorrect approach.Thanks.
Environment
version: 2.8.0 Swift Package Manager iOS 15.0 Xcode version: 15.0