iOS engineer who likes clean, simple designs and sans-serif.

Loading

CocoaPod Favorites – Shimmer + MZTimerLabel

Here are two CocoaPods I really like for their simplicity, ease of use and impact:

1) Facebook’s 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.

https://github.com/facebook/Shimmer

Sample Code:

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;

2) MZTimerLabel
MZTimerLabel is a UILabel subclass, which is a handy way to use UILabel as a countdown timer or stopwatch just like that in Apple Clock App with just 2 lines of code. MZTimerLabel also provides delegate method for you to define the action when the timer finished.

MZTimerLabelScreenshot

https://github.com/mineschan/MZTimerLabel

To use MZTimerLabel as a stopwatch and counter, you need only 2 lines.

    MZTimerLabel *stopwatch = [[MZTimerLabel alloc] initWithLabel:aUILabel];
    [stopwatch start];

Easy? If you are looking for a timer, things is just similar.

    MZTimerLabel *timer = [[MZTimerLabel alloc] initWithLabel:aUILabel andTimerType:MZTimerLabelTypeTimer];
    [timer setCountDownTime:60];
    [timer start];

Leave a Comment