Integrate Facebook Shimmer into Swift App

Aaron Douglas demonstrates how to use an Objective-C bridging header to integrate the popular Facebook Shimmer library (think “Slide to unlock”) into a Swift application.

Here’s the basic idea of how Shimmer works:

“Shimmer sets up the gradient layer to make part of the content view more transparent than other parts – i.e. the area that is “not shimmering” is 50% transparent, and the area that is shimmering is not transparent at all, so it appears like a highlight. It also runs an animation to move the gradient along the shimmer view, from left to right by default.”