Ad

Our DNA is written in Swift
Jump

4 Radars: Percentage-driven Modal Transitions

I wanted to add a custom modal transition for the prod.ly app when you tap on a thumbnail image. I wanted to make a tutorial about that as soon as understood interactive transitions, but stumbled over a couple of bugs.

Of these one I would consider quite severe and new as of iOS 8.3, which made it a show-stopper. As long as this bug is present I cannot add an interactive percent-driven dismissal transition to my app.

Using the iOS-provided UIPercentDrivenInteractiveTransition is doing something interesting: it runs the transition animation through and remembers the states at any given percentage value. This way you can scrub through the animation forwards and backwards, but as a developer you never have to set up any individual frames.

This is a first for me, being able to demonstrate 4 issues with a single test app. As usual, the TransitionTest sample app is on my Radar Samples GitHub repository.


Percent-driven Interactive Animation has side effect on cancel at 0%

Files as rdar://20068860 and on Open Radar.

Summary

If you have a full screen modal presentation with an interactive dismissal, there is a new side effect on iOS 8.3 when cancelling the dismissal transition at 0%. See attached screen shot.

Steps to Reproduce

  1. Run the provided sample app
  2. Tap on “Open”
  3. Start pinching to begin an interactive dismissal
  4. Make your pinch wider than the original distance so that the presented VC is again fully visible
  5. Lift your fingers

Expected Results

  • The presented view controller should be visible and cover the entire display

Actual Results

  • An incorrect vertical scale transform seems to be applied
  • You only see 7 vertical blue bars at the location of the close button
  • i.e. see screen shot
    Transition Bug

Notes

The same sample does not produce this side effect and instead behaves as expected.


Percent-driven interactive transition does not animate between status bar states

Filed as rdar://20069154 and on Open Radar.

Summary

Modal transitions between view controllers with different status bars should animate the status bar style and visibility in tandem with the transition.

Steps to Reproduce

  • Launch the provided sample app.
  • Tap on the Open button
  • Note that the presented VC has a white status bar
  • start closing the presented VC by a closing pinch gesture

Expected Results

  • The white status bar text should gradually cross-fade to black text
  • This cross-fade should be coupled with the percent of the percent driven transition

Actual Results

  • The text color changes to black right after the interactive transition was started
    The text color jumps to white if the interactive transition is cancelled

Notes

The same problem exists if the presented VC has a hidden status bar. In that case I would expect the status bar to fade out during presentation and fade in gradually according to the percentage during interactive dismissal.


Percent-driven interactive animation does not animate tintAdjustmentMode

Filed as rdar://20069240 and on Open Radar.

Summary

A presented VC with tintAdjustmentMode dimmed should dim buttons on the presenting view controller’s view. Interactive percentage-driven dismissal should gradually undim the presenting view controller’s view’s button.

Steps to Reproduce

  • Run the provided sample app.
  • When you tap Open, note that the “Open” becomes black (as it is dimmed)
  • When you either tap Close or make a closing pinch gesture the Open is blue right away, visible through the dimming view

Expected Results

  • the more of the presenting VC is visible the more un-dimmed its buttons should be

Actual Results

  • as soon as any part of the presenting VC is visible again, the buttons are fully undimmed

Using UIModalPresentationOverFullScreen with interactive dismissal blanks presenting VC

Filed as rdar://20069328 and on Open Radar.

Summary

When using UIModalPresentationOverFullScreen instead the default or UIModalPresentationFullScreen presentation mode, interactively dismissing the presented VC first shows the presented VC, but upon completion of the dismissal the presenting VC’s view goes black.

Steps to Reproduce

  1. Open the provided sample app in Xcode
  2. In the story board change the presentation mode of the segue to UIModalPresentationOverFullScreen
  3. Run the app
  4. Tap on Open
  5. Begin to interactively dismiss the presented VC by making a closing pinch gesture
  6. Pinch close enough to fully dismiss the VC

Expected Results

  • the appearing presenting VC should remain visible

Actual Results

  • the re-appearing presenting VC goes to black after the transition concludes

Categories: Bug Reports

Leave a Comment