Interactive Glass Bottom Bar

Add interactive feedbacks for the glass bottom bar

Goals

  • Add "press to scale" animation to the glass bottom bar

What you will learn

  • Handle the transformations (scale, rotation) correctly

  • Make use of layerBlock parameter of the drawBackdrop modifier

Steps

1

Press to scale

Update the code for the glass bottom bar.

Press the bottom bar.

Oops! The backdrop is misplaced, it will also scale with the bottom bar. But the backdrop shouldn't scale.

2

Prevent backdrop from scaling

Move the code in graphicsLayer to layerBlock in the drawBackdrop modifier.

Press the bottom bar again.

It works correctly! The content will scale but the backdrop won't scale.

Final code

chevron-rightFinal codehashtag

Last updated