Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting a glowContainerView removes UICollectionViewCell#contentView from hierarchy #21

Open
mskrischke opened this issue Dec 18, 2020 · 3 comments

Comments

@mskrischke
Copy link

mskrischke commented Dec 18, 2020

Hello and first of all thanks for a great library!

With version > 3.0.0 or more specifically since commit acaa9b6 I see an issue with setting a custom glowContainerView on the ParallaxEffectOptions property of my UICollectionViewCell. No matter how I set the glowContainerView property it results in the cell's contentView being removed from its superview and the cell has no visible content in the UICollectionView.

My cell inherits from ParallaxCollectionViewCell and in awakeFromNib() or setupParallax() I would like to customize the ParallaxEffectOptions by using the options property and set a different glowContainerView. The glowContainerView property however is at this point already initialized with the cell's contentView (happens in ParallaxCollectionViewCell#commonInit). Setting a different glowContainerView subsequently leads to the contentView being removed from its superview by a property observer. As commonInit is called from the initializer I couldn't find a way to set my own glowContainerView before the contentView is set as default.

My first guess for a fix would be to remove the property observer on glowContainerView so that it doesn't change the view hierarchy. I am not sure of possible side effects however.

Kind regards and all the best,
Markus

@koczka
Copy link

koczka commented Aug 9, 2021

I have the exact same issue, the only difference is I don't use a nib for the ui, I built it from code.

@romainbiard
Copy link

Same issue here

@cxfksword
Copy link

Same issue in tvOS 15.0 SwiftUI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants