louisdh / panelkit

A UI framework that enables panels on iOS.
MIT License
3.79k stars 160 forks source link

Whenever the Panel is closed while floating or in pinned state, the contentViewController is not aware of being dismissed #10

Closed JacobBoyd closed 6 years ago

JacobBoyd commented 7 years ago

First Let me say that I have really enjoyed using this! I love the ability to drag around a popover!

I just wanted to add that I am using version 0.8.2, and this is a kind of simple fix to allow the contentViewController to be aware it will be dismissed!

I can add this in for you, no problem! I am using PanelKit in one of my projects that is also using obj-c pods so I had to download the master manually include it in my project so my Cocoapods didn't clash, but overall this is great.

`extension PanelManager where Self: UIViewController {

func close(_ panel: PanelViewController) {

    if (panel.contentViewController != nil) {
        panel.contentViewController!.viewWillDisappear(true)
    }

    panel.view.removeFromSuperview()

    panel.contentViewController?.didUpdateFloatingState()

    if panel.isPinned {
        didDragFree(panel)
    }
}

}`

louisdh commented 7 years ago

0.8.2 is an old version, can you update to PanelKit 1.0?

JacobBoyd commented 7 years ago

I will do that later today, I haven't been back to the page until today and didn't release a newer version was released :)