HeroTransitions / Hero

Elegant transition library for iOS & tvOS
https://HeroTransitions.github.io/Hero/
MIT License
22k stars 1.72k forks source link

need help, match hero animation across multiple preseting viewcontollers #766

Open davidfuzju opened 10 months ago

davidfuzju commented 10 months ago

What did you do?

My trasition animation process like this:

  1. B viewcontroller is in a navigation controller, then presenting I viewcontroller which enable hero and b.hero.id == i.hero.id, I viewcontroller's modalPresentationStyle is .overCurrentContext
  2. after presening, the navigation controller will push a viewcontroller C with subview c, and b.hero.id == i.hero.id == c.hero.id
  3. then dismiss I viewcontroller

image

What did you expect to happen?

  1. when presenting I view controller, b and i will perform match animation
  2. after push C view controller, I view controller is presenting over C view controller's content
  3. when dismiss I view controller, i and c will perform match animation

What happened instead?

  1. as expected
  2. as expected
  3. not as expected, C view controller will show subview c, and i and c will perform dismiss transition animation,hero won't remove c from view in animation initial state

General Information

1.6.2

16.6.1

Swift 5

iPhone 13 Pro Max

Demo Project

davidfuzju commented 10 months ago

animation like this, is there any method to make subview c in C view controller prepare for hero dismiss transition animation from subview b in B view controller? https://github.com/HeroTransitions/Hero/assets/3890843/df0f8d02-1ac4-4885-b205-680c21345e25