We are considering using Hero for transitions within our application and have been trialing it out today.
We are having an issue with a close button flashing during a modal presentation of a details view controller.
The rootVC is a collection view with cells in that once tapped open a details view. The collection view cells have an image and 3 labels which are also present on the details screen. These are matched up with hero IDs and animate as expected. On the details screen there is a dismiss button in the top left (on top of the imageView). This does not have heroID as it is not on ht previous view controller ad we just expect it to fade in.
As you can see in the video the button appears to fade in then become 100% visible before fading in again causing a sort of flash.
Any suggestions to what we could be doing wrong?
Thanks in advanced for you help and working on this library.
RootVC
``` func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell: DealCardCellCollectionViewCell = collectionView.dequeueReusableCell(forIndexPath: indexPath)
let deal = deals[indexPath.row]
cell.configure(for: deal)
cell.dealCard.imageView.hero.id = deal.id + "_offerImage"
cell.dealCard.titleLabel.hero.id = deal.id + "_offerTitle"
cell.dealCard.descriptionLabel.hero.id = deal.id + "_offerDescription"
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
let deal = deals[indexPath.row]
let detailsVC = OfferDetailsViewController.makeFromStoryboard()
detailsVC.deal = deal
detailsVC.hero.isEnabled = true
self.present(detailsVC, animated: true, completion: nil)
}
// called from viewDidLoad
private func configureHeroIdentifiers() {
imageView.hero.id = deal.id + "_offerImage"
titleLabel.hero.id = deal.id + "_offerTitle"
descriptionLabel.hero.id = deal.id + "_offerDescription"
}
```


Give the button these modifiers: .fade, .useGlobalCoordinateSpace
Thanks useGlobalCoordinateSpace seems to be the magic modifier. Could you give me an explanation of what the flag does?
I have created custom transitions before so I would guess that this flag brings a snapshot of the view out into the containing view that performs the transition. Is that roughly right?
@bencallis Checkout this post that I just wrote. http://lkzhao.com/2018/03/02/hero-useglobalcoordinatespace-explained.html
Thanks very much for that!
Most helpful comment
@bencallis Checkout this post that I just wrote. http://lkzhao.com/2018/03/02/hero-useglobalcoordinatespace-explained.html