A fast and efficient UIView subclass which renders its own reflection, live.
BDMirrorView
is a CAReplicatorLayer
-backed UIView
subclass which can be used to render a live content reflection in an iOS app. If you're struggling to understand why this view exists, just think back to Cover Flow (rip..) and the reflection below each item....
To run the example project, clone the repo, and run pod install
from the Example directory first.
- Render a reflection on the top, left, bottom or right-hand side of the view.
- Customise the distance of the reflection from the parent.
- Use a masking gradient, or not.
Set the class of the UIView to BDMirrorView
in the Storyboard, or create an IBOutlet. 🙌
BDMirrorView
will work wherever this version of Swift will compile.
Download the repo and add it into your Xcode project.
pod 'BDMirrorView'
No reason. Have fun!
BDMirrorView
was created by Benjamin Deckys
BDMirrorView
is available under the MIT license. Please see the LICENSE file for more information.