File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -372,11 +372,20 @@ export class Page extends pageCommon.Page {
372372 this . _ios . modalPresentationStyle = UIModalPresentationStyle . UIModalPresentationFormSheet ;
373373 this . _UIModalPresentationFormSheet = true ;
374374 }
375-
375+
376376 super . _raiseShowingModallyEvent ( ) ;
377377
378378 parent . ios . presentViewControllerAnimatedCompletion ( this . _ios , utils . ios . MajorVersion >= 7 , null ) ;
379- UIViewControllerTransitionCoordinator . prototype . animateAlongsideTransitionCompletion . call ( parent . ios . transitionCoordinator ( ) , null , ( ) => this . _raiseShownModallyEvent ( ) ) ;
379+ let transitionCoordinator = parent . ios . transitionCoordinator ( ) ;
380+ if ( transitionCoordinator ) {
381+ UIViewControllerTransitionCoordinator . prototype . animateAlongsideTransitionCompletion . call ( transitionCoordinator , null , ( ) => this . _raiseShownModallyEvent ( ) ) ;
382+ }
383+ else {
384+ // Apparently iOS 9+ stops all transitions and animations upon application suspend and transitionCoordinator becomes null here in this case.
385+ // Since we are not waiting for any transition to complete, i.e. transitionCoordinator is null, we can directly raise our shownModally event.
386+ // Take a look at https://github.com/NativeScript/NativeScript/issues/2173 for more info and a sample project.
387+ this . _raiseShownModallyEvent ( ) ;
388+ }
380389 }
381390
382391 protected _hideNativeModalView ( parent : Page ) {
You can’t perform that action at this time.
0 commit comments