I am using UIReferenceLibraryViewController and would like to play sound when it is dismissed. I am calling my sound in my main controller’s viewWillAppear event. However if I change UIReferenceLibraryViewController ModalTransitionStyle style to UIModalTransitionStylePartialCurl, viewWillAppear is not triggered. Is there any other way I can capture its dismissal?
I am using UIReferenceLibraryViewController and would like to play sound when it is dismissed.
Share
It makes sense that your main controller’s
viewWillAppearmethod is not called withUIModalTransitionStylePartialCurlwhen theUIReferenceLibraryViewControlleris dismissed because your main controller’s view was never completely removed from the screen. What you really are interested in is when theUIReferenceLibraryViewControlleris dismissed, not when your main controller appears so structure your code accordingly. That is, subclassUIReferenceLibraryViewControllerand put your sound playing into the subclass’sviewWillDisappearorviewDidDisappear. This will work for any transition style.