1

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?

Vlad Z
  • 383
  • 2
  • 12
  • 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 Answers1

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