facebookarchive /Shimmer
An easy way to add a simple, shimmering effect to any view in an iOS app.
★ 9,309⑂ 1,112👁 0⑃ 37● 54▤ 0
+0
Daily
9,309
stars
1,112
forks
0
watchers
37
prs
54
issues
0
releases
README
Shimmer Shimmer is an easy way to add a shimmering effect to any view in your app. It's useful as an unobtrusive loading indicator. Shimmer was originally developed to show loading status in Paper. !Shimmer Usage To use Shimmer, create a FBShimmeringView or FBShimmeringLayer and add your content. To start shimmering, set the shimmering property to YES. An example of making a label shimmer: objective-c FBShimmeringView shimmeringView = [[FBShimmeringView alloc] initWithFrame:self.view.bounds]; [self.view addSubview:shimmeringView]; UILabel loadingLabel = [[UILabel alloc] initWithFrame:shimmeringView.bounds]; loadingLabel.textAlignment = NSTextAlignmentCenter; loadingLabel.text = NSLocalizedString(@"Shimmer", nil); shimmeringView.contentView = loadingLabel; // Start shimmering. shimmeringView.shimmering = YES; There's also an example project. In the example, you can swipe horizontally and vertically to try various shimmering parameters, or tap to start or stop shimmering. (To build the example locally, you'll need to open FBShimmering.xcworkpace rather than the .xcodeproj.) Installation There are two options: 1. Shimmer is available as Shimmer in Cocoapods. 2. Manually add the files into your Xcode project. Slightly simpler, but updates are also manual. Shimmer requires iOS 6 or later. How it works Shimmer uses the -[CALayer mask] property to enable shimmering, similar to what's described in John Harper's 2009 WWDC talk (unfortunately no longer online). Shimmer uses CoreAnimation's timing features to smoothly transition "on-beat" when starting and stopping the shimmer. Other Platforms We have a version of Shimmer for Android, too! It's also available on GitHub. Contributing See the CONTRIBUTING file for how to help out. License Shimmer is BSD-licensed.
Top issues
#39Ability to change the shimmer colour?12 comments · 2015-03-05#106What happened with this repo? 5 comments · 2018-04-27#99please show an example of using this in swift 3 or 4.4 comments · 2017-09-29#77Xcode 8.3 warning 3 comments · 2017-03-28#85Mask angle/tilt2 comments · 2017-08-30#69Tag a new release ?2 comments · 2016-11-10#110Carthage support for Shimmer1 comments · 2020-01-22#103Updates please!1 comments · 2018-01-02