SpinKit 1.2.0

SpinKit 1.2.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Ramon Torres.



SpinKit 1.2.0

  • By
  • Ramon Torres

SpinKit-ObjC

UIKit port of SpinKit.

Installing

CocoaPods is the recommended way for adding SpinKit to your project.

pod 'SpinKit', '~> 1.1'

If you are not yet using CocoaPods, I definetly recommend you to check out their Getting Started guide and the NSHipster article.

Usage

Simply instantiate RTSpinKitView with the desired style and add to your view hierarchy.

#import <SpinKit/RTSpinKitView.h>
...
RTSpinKitView *spinner = [[RTSpinKitView alloc] initWithStyle:RTSpinKitViewStyleWave];
[self.view addSubview:spinner];

You can change the size of the spinner by manipulating the spinnerSize property. The default size is 37.0.

spinner.spinnerSize = 100.0;
[spinner sizeToFit];

Available styles:

  • RTSpinKitViewStylePlane
  • RTSpinKitViewStyleCircleFlip
  • RTSpinKitViewStyleBounce
  • RTSpinKitViewStyleWave
  • RTSpinKitViewStyleWanderingCubes
  • RTSpinKitViewStylePulse
  • RTSpinKitViewStyleChasingDots
  • RTSpinKitViewStyleThreeBounce
  • RTSpinKitViewStyleCircle
  • RTSpinKitViewStyle9CubeGrid
  • RTSpinKitViewStyleWordPress
  • RTSpinKitViewStyleFadingCircle
  • RTSpinKitViewStyleFadingCircleAlt
  • RTSpinKitViewStyleArc
  • RTSpinKitViewStyleArcAlt

MBProgressHUD

SpinKit integrates nicely with the amazing MBProgressHUD library:

RTSpinKitView *spinner = [[RTSpinKitView alloc] initWithStyle:RTSpinKitViewStyleWave color:[UIColor whiteColor]];

MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.square = YES;
hud.mode = MBProgressHUDModeCustomView;
hud.customView = spinner;
hud.labelText = NSLocalizedString(@"Loading", @"Loading");

[spinner startAnimating];

Acknowledgements

Animations based on SpinKit by Tobias Ahlin.

SpinKit Contributors.