Coder Social home page Coder Social logo

lifedim / svprogresshud Goto Github PK

View Code? Open in Web Editor NEW

This project forked from svprogresshud/svprogresshud

0.0 0.0 0.0 228 KB

A clean and lightweight progress HUD for your iOS app.

Home Page: http://samvermette.com/199

License: Other

Ruby 2.77% Objective-C 97.23%

svprogresshud's Introduction

Important note if your project doesn’t use ARC: you must add the -fobjc-arc compiler flag to SVProgressHUD.m in Target Settings > Build Phases > Compile Sources.

SVProgressHUD is an easy-to-use, clean and lightweight progress HUD for iOS. It’s a simplified and prettified alternative to the popular MBProgressHUD. The success and error icons are from Glyphish.

SVProgressHUD features:

  • very simple singleton convenience methods ([SVProgressHUD show], [SVProgressHUD dismiss], etc.)
  • display of status strings and/or images to quickly communicate the state of the ongoing task
  • automatic positioning based on device type, orientation and keyboard visibility
  • optionally disable user interactions for ongoing tasks using a maskType parameter

Installation

  • Drag the SVProgressHUD/SVProgressHUD folder into your project.
  • Add the QuartzCore framework to your project.

If you plan on using SVProgressHUD in a lot of places inside your app, I recommend importing it directly inside your prefix file.

Usage

(see sample Xcode project in /Demo)

SVProgressHUD is created as a singleton (i.e. it doesn’t need to be explicitly allocated and instantiated; you directly call [SVProgressHUD method]) and can be shown using one of the following convenience/class methods:

+ (void)show;
+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType;
+ (void)showWithStatus:(NSString*)string;
+ (void)showWithStatus:(NSString*)string maskType:(SVProgressHUDMaskType)maskType;

It can be dismissed using:

+ (void)dismiss;

Optionally, you can have the HUD display a status and/or an image glyph before automatically getting dismissed 1s later (not customizable anymore to discourage lenghty status strings — for which UIAlertViews would be more appropriate).

+ (void)showSuccessWithStatus:(NSString*)string;
+ (void)showErrorWithStatus:(NSString *)string;
+ (void)showImage:(UIImage*)image status:(NSString*)string; // use 28x28 white pngs

SVProgressHUDMaskType

You can optionally disable user interactions while a task is being completed by using the show methods that support the maskType property:

enum {
    SVProgressHUDMaskTypeNone = 1, // allow user interactions, don't dim background UI (default)
    SVProgressHUDMaskTypeClear, // disable user interactions, don't dim background UI
    SVProgressHUDMaskTypeBlack, // disable user interactions, dim background UI with 50% translucent black
    SVProgressHUDMaskTypeGradient // disable user interactions, dim background UI with translucent radial gradient (a-la-alertView)
};

Credits

SVProgressHUD is brought to you by Sam Vermette and contributors to the project. If you have feature suggestions or bug reports, feel free to help out by sending pull requests or by creating new issues. If you’re using SVProgressHUD in your project, attribution would be nice.

svprogresshud's People

Contributors

samvermette avatar gcamp avatar inamiy avatar bobbypage avatar georgbachmann avatar jparise avatar julienp avatar alloy avatar pluton8 avatar lifedim avatar jwilling avatar massimobio avatar spenrose avatar sguillope 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.