SebastianBoldt / Jelly

🌊 - Jelly is a library for animated, non-interactive & interactive viewcontroller transitions and presentations with the focus on a simple and yet flexible API.
http://www.sebastianboldt.com/
MIT License
2.45k stars 121 forks source link

viewWillDisappear never called #45

Closed Maryom closed 7 years ago

Maryom commented 7 years ago

Hi,

Thanks for your repo. Before I used Jelly viewWillDisappear was called. Now with Jelly viewWillDisappear never called! Any help?

override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        print("Hey")
}
SebastianBoldt commented 7 years ago

This has to to with the nature of modal viewControllers in iOS. Please consult Stackoverflow for more information: https://stackoverflow.com/questions/29271880/viewdidappear-not-called-when-the-modal-view-is-dismissed

One thing you could do is to build up a delegate chain between the presenting and the presented viewController to react to the events you want.

Maryom commented 7 years ago

@SebastianBoldt Thank you. I solved my problem as following:

present(homeVC, animated: true) { _ in

            UserDefaults.standard.set(Sound.currentShaik, forKey: "currentShaik")

}