HeroTransitions / HeroTransitions/Hero

UIViews losing their backgroundColor during transition

Open
#670 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
22.5k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

## What did you do?

In my project, there are a series of UIViewControllers that all share a common background UIImageView. Using Hero, I set `navigationController?.hero.isEnabled = true`. Then I set the `heroId` of the imageView that contains the same image from each ViewController.

```
self.bgImageView.hero.id = "bgImageView"
nextVc.bgImageView.hero.id = "bgImageView"
```

I then call `pushViewController`

## What did you expect to happen?

I would expect the background image to persist during the transition, but for the other elements to be replaced in the slide animation.

## What happened instead?

This does happen, however UIViews that have their backgroundColor set lose their backgroundColor and become clear during the transition.

![heroIssue](https://user-images.githubusercontent.com/6395840/82632218-303bb400-9c2a-11ea-9a1a-f408a061b172.gif)

If I remove the hero identifiers on the background imageView, the UIButton and UITextField's act as expected, retaining their backgroundColor.

## General Information

* Hero Version: 1.5.0

* iOS Version(s): 13.4

* Swift Version: 5

* Devices/Simulators: iPhone 11 Pro Simulator, iPhone 11 Pro

* Reproducible in Examples? (Yes/No): Yes

## Demo Project

https://github.com/logananderson/HeroIssueExample

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.