A progress HUD using BFRadialWaveView.
Objective-C Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
BFRadialWaveHUD.xcodeproj v1.5.5! Finished updating for Xcode 8 and cleaning up pods. Oct 19, 2016
BFRadialWaveHUD.xcworkspace
BFRadialWaveHUD
BFRadialWaveHUDTests
Categories Moved all UIImage Categories into a 'Categories' directory, and updat… Feb 25, 2015
Classes Updated all show functions to take a containerView parameter instead … Dec 26, 2016
Pods
Resources Moved all UIImage Categories into a 'Categories' directory, and updat… Feb 25, 2015
.DS_Store Updated all show functions to take a containerView parameter instead … Dec 26, 2016
.gitignore
BFRadialWaveHUD.podspec version 2.0.0! Updated CHANGELOG, README, .podspec, and project build… Dec 27, 2016
BFRadialWaveHUDDemo.gif Updated README. Added CHANGELOG.md. Added cocoapod support. Removed -… Feb 23, 2015
BFRadialWaveHUDDemoFrame1.png
BFRadialWaveHUDDemoFrame2.png Updated README. Added CHANGELOG.md. Added cocoapod support. Removed -… Feb 23, 2015
BFRadialWaveHUDDemoFrame3.png
BFRadialWaveHUDDemoFrame4.png
CHANGELOG.md
LICENSE.md initial commit from local git Feb 23, 2015
Podfile
Podfile.lock
README.md Merge branch 'release-2.0.0' Dec 27, 2016

README.md

BFRadialWaveHUD

CocoaPods

A progress HUD using BFRadialWaveView. Huge thanks to github user @kevin-hirsch for making his amazing KVNProgress HUD available under the MIT license! Most of the actual HUD code, as well as ALL of the image processing code is from that project. Thanks again!

Click the screenshot below for an animated gifv!
Animated Screenshot

About

BFRadialWaveHUD is a fully customizable progress HUD that supports fullscreen, background blurring, dynaically changing message text, and disco time. The purpose of BFRadialWaveViewHUD is to mesmerize and hypnotize your users into forgetting that they were waiting for something to load. Seriously, just stare at it for a while. Also to give glory to the hypnotoad.
BFRadialWaveHUD uses BFRadialWaveView.

Changes

Please refer to this CHANGELOG.md.

To do:

  • Restart animations on app wake-up. (Note, this is something to fix for BFRadialWaveView)
  • Move resources into a resource directory, reflecting this change in the cocoapod. (Fix file structure)

Modes

BFRadialWaveHUDMode_Default       // Default: A swirly looking thing.
BFRadialWaveHUDMode_KuneKune      // Kune Kune: A creepy feeler looking thing.
BFRadialWaveHUDMode_North         // North: Points upwards.
BFRadialWaveHUDMode_NorthEast     // North East: Points upwards to the right.
BFRadialWaveHUDMode_East          // East: Points right.
BFRadialWaveHUDMode_SouthEast     // South East: Points downwards to the right.
BFRadialWaveHUDMode_South         // South: Points down.
BFRadialWaveHUDMode_SouthWest     // South West: Points downwards to the left.
BFRadialWaveHUDMode_West          // West: Points left.
BFRadialWaveHUDMode_NorthWest     // North West: Points at Kanye.

Methods

Initializer

Use this when you make a BFRadialWaveHUD in code.

/**
 *  Custom initializer. Use this when you make a BFRadialWaveHUD in code.
 *
 *  @param fullscreen      BOOL flag to display in fullscreen or not.
 *  @param numberOfCircles NSInteger number of circles. Min = 3, Max = 20.
 *  @param circleColor     UIColor to set the circles' strokeColor to.
 *  @param mode            BFRadialWaveHUDMode
 *  @param strokeWidth     CGFloat stroke width of the circles.
 *
 *  @return Returns a BFRadialWaveHUD! Aww yiss!
 */
- (instancetype)initWithFullScreen:(BOOL)fullscreen
                           circles:(NSInteger)numberOfCircles
                       circleColor:(UIColor *)circleColor
                              mode:(BFRadialWaveHUDMode)mode
                       strokeWidth:(CGFloat)strokeWidth;

Loading

/**
 *  Show an indeterminate HUD.
 *
 *  @param containerView   The UIView to place the HUD in.
 */
- (void)showInView:(UIView *)containerView;
/**
 *  Show an indeterminate HUD with a message.
 *
 *  @param message          NSString message to display below the spinning BFRadialWaveView.
 *  @param containerView    The UIView to place the HUD in.
 */
- (void)showWithMessage:(NSString *)message
                 inView:(UIView *)containerView;

Progress

/**
 *  Show a BFRadialWaveHUD with an extra circle for progress.
 *
 *  @param progress         CGFloat progress (range [0.f, 1.f]) to show.
 *  @param containerView    The UIView to place the HUD in.
 */
- (void)showWithProgress:(CGFloat)progress
                  inView:(UIView *)containerView;
/**
 *  Show a BFRadialWaveHUD with an extra circle for progress with a message.
 *
 *  @param progress         CGFloat progress (range [0.f, 1.f]) to show.
 *  @param message          NSString message to display below the spinning BFRadialWaveView.
 *  @param containerView    The UIView to place the HUD in.
 */
- (void)showWithProgress:(CGFloat)progress
             withMessage:(NSString *)message
                  inView:(UIView *)containerView;

Success

/**
 *  Show a success checkmark, indicating success.
 *
 *  @param containerView    The UIView to place the HUD in.
 */
- (void)showSuccessInView:(UIView *)containerView;
/**
 *  Show a success checkmark and run a block of code after it completes.
 *
 *  @param containerView    The UIView to place the HUD in.
 *  @param completionBlock  A block of code to run on completion.
 */
- (void)showSuccessInView:(UIView *)containerView
           withCompletion:(void (^)(BOOL finished))completionBlock;
/**
 *  Show a success checkmark with a message.
 *
 *  @param message          NSString message to display below the spinning BFRadialWaveView.
 *  @param containerView    The UIView to place the HUD in.
 */
- (void)showSuccessWithMessage:(NSString *)message
                        inView:(UIView *)containerView;
/**
 *  Show a success checkmark with a message and run a block of code after it completes.
 *
 *  @param message          NSString message to display below the spinning BFRadialWaveView.
 *  @param containerView    The UIView to place the HUD in.
 *  @param completionBlock  A block of code to run on completion.
 */
- (void)showSuccessWithMessage:(NSString *)message
                        inView:(UIView *)containerView
                    completion:(void (^)(BOOL finished))completionBlock;

Error

/**
 *  Show an error 'X', indicating failure/error.
 *
 *  @param containerView    The UIView to place the HUD in.
 */
- (void)showErrorInView:(UIView *)containerView;
/**
 *  Show an error 'X' and run a block of code after it completes.
 *
 *  @param containerView    The UIView to place the HUD in.
 *  @param completionBlock  A block of code to run on completion.
 */
- (void)showErrorInView:(UIView *)containerView
         withCompletion:(void (^)(BOOL finished))completionBlock;
/**
 *  Show an error 'X' with a message.
 *
 *  @param message          NSString message to display below the spinning BFRadialWaveView.
 *  @param containerView    The UIView to place the HUD in.
 */
- (void)showErrorWithMessage:(NSString *)message
                      inView:(UIView *)containerView;
/**
 *  Show an error 'X' with a message and run a block of code after it completes.
 *
 *  @param message          NSString message to display below the spinning BFRadialWaveView.
 *  @param containerView    The UIView to place the HUD in.
 *  @param completionBlock  A block of code to run on completion.
 */
- (void)showErrorWithMessage:(NSString *)message
                      inView:(UIView *)containerView
                  completion:(void (^)(BOOL finished))completionBlock;

Dismiss

/**
 *  Dimiss a BFRadialWaveHUD.
 */
- (void)dismiss;
/**
 *  Dimiss a BFRadialWaveHUD and run a block of code after it completes.
 *
 *  @param completionBlock A block of code to run on completion.
 */
- (void)dismissWithCompletion:(void (^)(BOOL finished))completionBlock;
/**
 *  Dimiss a BFRadialWaveHUD after a delay has passed.
 *
 *  @param delayInSeconds CGFloat of seconds to delay before fading away.
 */
- (void)dismissAfterDelay:(CGFloat)delayInSeconds;
/**
 *  Dismiss a BFRadialWaveHUD after a delay has passed and run a block of code after it completes.
 *
 *  @param delayInSeconds CGFloat of seconds to delay before fading away.
 *  @param completionBlock A block of code to run on completion.
 */
- (void)dismissAfterDelay:(CGFloat)delayInSeconds
           withCompletion:(void (^)(BOOL finished))completionBlock;

Update

/**
 *  Update the message written below the BFRadialWaveView spinner.
 *
 *  @param message NSString message to display.
 */
- (void)updateMessage:(NSString *)message;
/**
 *  Update the progress to display.
 *
 *  @param progress CGFloat progress (range [0.f, 1.f]) to display.
 */
- (void)updateProgress:(CGFloat)progress;

Pause and Resume

/** Pause the animation. */
- (void)pause;

/** Resume the animation. */
- (void)resume;

Fun

/**
 *  Activate of Deactivate disco mode! This will rapidly cycle colors through your BFRadialWaveView. Without setting the colors explicitly, a rainbow is used.
 *
 *  @param on BOOL flag to turn disco mode on (YES) or off (NO).
 */
- (void)disco:(BOOL)on;

Properties

Message

/** UIFont for the message label below the BFRadialWaveView spinner. */
@property (nonatomic) UIFont *messageFont;
/** UIColor for the textColor of the message label below the BFRadialWaveView spinner. */
@property (nonatomic) UIColor *messageColor;

HUD

/** UIColor for the HUD. This is also the color used when in fullscreen. Colors with high alpha values are recommended to help block out the content behind the HUD. */
@property (nonatomic) UIColor *HUDColor;
/** UIColor for the background of non-fullscreen HUDs. Colors with high alpha values are recommended to help block out the content behind the HUD. */
@property (nonatomic) UIColor *backgroundFadeColor;
/** The UIColor to set the progress circle to. Default is the same as the circleColor passed into the initializer or the setup. */
@property (nonatomic) UIColor *progressCircleColor;

Success and Error

/** The color to set the success checkmark to. By default it is the same as the circleColor passed into the initializer or the setup. */
@property (nonatomic) UIColor *checkmarkColor;
/** The color to set the failure cross to. By default it is the same as the circleColor passed into the initializer or the setup. */
@property (nonatomic) UIColor *crossColor;

Behavior

/** BOOL flag to set whether to dismiss on tap (YES) or ignore taps (NO). */
@property (nonatomic) BOOL tapToDismiss;
/** Block to run after dismissal via tap. */
@property (nonatomic, copy) void (^tapToDismissCompletionBlock)(BOOL finished);
/** A READONLY BOOL flag for your convenience. Returns YES when the HUD is showing, and NO when it is not. */
@property (readonly) BOOL isShowing;
/** BOOL flag to set whether to blur the background (YES) or not (NO). */
@property (nonatomic) BOOL blurBackground;

Disco

/** An NSArray of colors to use for disco mode. By default it is the rainbow. */
@property (nonatomic) NSArray *discoColors;
/** CGFloat speed for the disco animation. Default is 0.33f. */
@property (nonatomic) CGFloat discoSpeed;

Usage

Be sure the check out the included demo app to see examples on how to use BFRadialWaveHUD. Add the contents of the three directories, Categories, Classes, and Resources to your project either manually or via cocoapods.

Working Example

// Create a HUD with default number of circles, default color, default mode, and default circle stroke width:
BFRadialWaveHUD *hud = [[BFRadialWaveHUD alloc] initWithFullScreen:NO
                                                           circles:BFRadialWaveHUD_DefaultNumberOfCircles
                                                       circleColor:nil
                                                              mode:BFRadialWaveHUDMode_Default
                                                       strokeWidth:BFRadialWaveHUD_DefaultCircleStrokeWidth];
[hud show];

Customized Example

// Create a very customized HUD:
BFRadialWaveHUD *hud = [[BFRadialWaveHUD alloc] initWithFullScreen:YES
                                                           circles:10
                                                       circleColor:[UIColor whiteColor]
                                                              mode:BFRadialWaveHUDMode_South
                                                       strokeWidth:4.f];
hud.blurBackground = YES; // default is NO
hud.tapToDismiss = YES; // default is NO
hud.progressCircleColor = [UIColor paperColorLightBlue];
hud.checkmarkColor = [UIColor paperColorGreen];
hud.crossColor = [UIColor paperColorRed];
hud.HUDColor = [UIColor colorWithWhite:1.f alpha:0.85f];
hud.backgroundFadeColor = [UIColor colorWithWhite:0.13f alpha:0.6f];
NSArray *discoColors = @[[UIColor paperColorIndigoA100],
                             [UIColor paperColorIndigoA200],
                             [UIColor paperColorIndigoA400],
                             [UIColor paperColorIndigoA700]];
[hud setDiscoColors:discoColors];
[hud showProgress:0.f withMessage:@"Downloading..."];

CocoaPods

CocoaPods are the best way to manage library dependencies in Objective-C projects. Learn more at http://cocoapods.org

Add this to your podfile to add BFRadialWaveHUD to your project.

platform :ios, '7.1'
pod 'BFRadialWaveHUD'

License

BFRadialWaveHUD uses the MIT License:

Please see included LICENSE file.