Closed stefanomondino closed 7 years ago
@stefanomondino Thanks for you contribution and pr. Instead of using inheritance I would like to stick with composition using existing ParallaxEffectOptions
struct that is used for this purpose. Please take a look at the changes that I have made and please let me know if that will work you.
Thanks, I total agree with your solution. I'll try it out in few days but seems good to me. Thank you very much:)
works like a charm! can you please merge it and release it?
Feature added with https://github.com/PGSSoft/ParallaxView/releases/tag/2.0.7
I would like to achieve some subview parallax effect in my custom collection view cells (created in a xib file). I have a
UIImageView
covering all the cell's space, with some text on top. The cell is aParallaxCollectionViewCell
subclass, and I'd like to use.basedOnTag
mode. This kind of behavior is currently not possiblein
public func addParallaxMotionEffects(with options: inout ParallaxEffectOptions)
the interpolation causing the parallax effect is applied to all the (first level) subviews, but a collection view cell only has one subview (the content view). All my subviews are inside the system-defined content view, so the intended effect will never be able to work properly. I'd like to change thesubviews
property used at line 87 (and 120) of UIView+ParallaxEffectsubviews .filter { $0 !== options.glowContainerView } .enumerated() .forEach { (index: Int, subview: UIView) in
to something like this
let subviews = (self as? ParallaxCollectionViewCell)?.contentView.subviews ?? self.subviews
Does this make sense?