Kngw Kngw
Kngw Kngw

Reputation: 61

How to animate a custom back button to the default back button in UINavigationBar?

I would like to replicate the back button transition seen in apps like the App Store or Apple Music. Specifically, I want to animate a custom-shaped back button into the default back button during navigation.

AppleMusic AppStore
enter image description here enter image description here

I initially considered changing backIndicatorImage and backIndicatorTransitionMaskImage, but since the custom button has a VisualEffect, it needs to be a custom UIView rather than just an image.

What would be the best approach to achieve this?

Using leftBarButtonItem seems like a viable option, but I’m unsure how to animate it into the default back button.

I don’t have a sample code yet since I’m not sure how to approach this. I would appreciate any guidance.

Upvotes: 0

Views: 21

Answers (0)

Related Questions