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?
Asked
Active
Viewed 373 times
1
-
I would use a delegate pattern. Here is an [sample][1] with similar task. [1]: http://stackoverflow.com/questions/8606674/uimodaltransitionstylepartialcurl-doesnt-get-back-to-previous-state-not-dismi/8607949#8607949 – user523234 Jul 28 '12 at 17:21
-
I am not dismissing UIReferenceLibraryViewController myself. – Vlad Z Jul 28 '12 at 17:24
1 Answers
2
It makes sense that your main controller's viewWillAppear
method is not called with UIModalTransitionStylePartialCurl
when the UIReferenceLibraryViewController
is dismissed because your main controller's view was never completely removed from the screen. What you really are interested in is when the UIReferenceLibraryViewController
is dismissed, not when your main controller appears so structure your code accordingly. That is, subclass UIReferenceLibraryViewController
and put your sound playing into the subclass's viewWillDisappear
or viewDidDisappear
. This will work for any transition style.

torrey.lyons
- 5,519
- 1
- 23
- 30
-
Glad it works for you. Be sure to check the gray checkmark next to the answer if so. That way others know the question is answered. – torrey.lyons Jul 29 '12 at 00:02
-