Code Monkey home page Code Monkey logo

acmaskhudview's Introduction

ACMaskHUDView

A simply HUDView

Installing

Drag ACMaskHUDView folder into your project. 
#import "ACMaskHUDView.h  

Usage

  • Initialization
// set delegate to your class
@interface YourViewController () <ACMaskHUDViewDelegate>

// add to your view
self.maskHUDView = [[ACMaskHUDView alloc] initWithFrame:self.view.bounds];
self.maskHUDView.delegate = self;
[self.view addSubview:self.maskHUDView];
  • ActivityIndicatorHUD
// show
[self.maskHUDView showActivityIndicatorHUD];

// show with text
[self.maskHUDView showActivityIndicatorHUDWithText:@"your loading string"];

  • RefreshHUD
// show 
[self.maskHUDView showRefreshHUD];

// show with a describe label
[self.maskHUDView showRefreshHUDWithText:@"your refresh describe"];

#pragma mark - ACMaskHUDViewDelegate

- (void)refreshButtonTapped
{
    // refresh action
}

  • NoticeHUD
// Show NoticeHUD with title and detail string, or title only or detail only.
// If both text string are nil, will simply show a "!" at center.
[self.maskHUDView showNoticeHUDWithTitleText:@"your notice title"
                                  detailText:@"your notice detail"];

  • Hide HUD
// Whatever it is showing hide it immediately.
[self.maskHUDView hideHUD];

// Hide with a duration time to fadeout and with or without a completion block 
[self.maskHUDView hideHUDWithDuration:0.4f completion:nil];
  • Rotation support
No need to do anything, it will fit CGRect automatically.
  • Notice
// If you want to show another HUD when you are already showing one, 
// just call show function, no need to call hide function before.

// For example, when you are requesting some data from network, 
// you are showing the ActivityIndicatorHUD at first, 
// when request failed, you want to show a RefreshHUD instead. 
// Just call RefreshHUD show function will be enough.
[self.maskHUDView showActivityIndicatorHUDWithText:@"loading..."];
[self.maskHUDView showRefreshHUDWithText:@"Loading error, please try again."];

// Especially notice this, if you are using 'hideHUDWithDuration:completion:' ,
// and you are going to show another HUD, call show function in completion block
[self.maskHUDView hideHUDWithDuration:0.36f completion:^(BOOL finished) {
    [self.maskHUDView showNoticeHUDWithTitleText:nil
                                      detailText:nil];
}];

Requirements

  • ARC

  • iOS 7+

License

######WTFPL

acmaskhudview's People

Contributors

co42de avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.