GithubHelp home page GithubHelp logo

tchigher / jgprogresshud Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonasgessner/jgprogresshud

0.0 0.0 0.0 18.71 MB

An elegant and simple progress HUD for iOS and tvOS, compatible with Swift and ObjC.

License: MIT License

Objective-C 98.79% Ruby 0.83% Swift 0.38%

jgprogresshud's Introduction

JGProgressHUD

An elegant and simple progress HUD for iOS and tvOS.

Overview

The ultimate progress HUD for iOS and tvOS is here: JGProgressHUD!

  • Plug and play: Simple integration, easy to use, few lines of code required.
  • Easily customizable (custom animations, indicator views and more).
  • Uses UIVisualEffectView and UIMotionEffect for a native look.
  • Uses AutoLayout to provide a fully dynamic layout.
  • Detects and repositions when keyboard appears/disappears.
  • Well documented and maintained.
  • Voice Over/UIAccessibility support.
  • Backward compatibility to iOS 8.
  • Can be used with Swift and Objective C.
  • And most importantly, it looks good!

Download the source code and open the Examples project to try JGProgressHUD and see all of its features in action!

GitHub release GitHub license CocoaPods Carthage compatible Carthage compatible

Examples

           

Showing indeterminate progress:

Objective C:

JGProgressHUD *HUD = [JGProgressHUD progressHUDWithStyle:JGProgressHUDStyleDark];
HUD.textLabel.text = @"Loading";
[HUD showInView:self.view];
[HUD dismissAfterDelay:3.0];

Swift:

let hud = JGProgressHUD(style: .dark)
hud.textLabel.text = "Loading"
hud.show(in: self.view)
hud.dismiss(afterDelay: 3.0)

This displays a dark HUD with an activity indicator and the title "Loading". The HUD is presented with a fade animation and is dismissed after 3 seconds with a fade animation.

Showing an error message:

JGProgressHUD *HUD = [JGProgressHUD progressHUDWithStyle:JGProgressHUDStyleDark];
HUD.textLabel.text = @"Error";
HUD.indicatorView = [[JGProgressHUDErrorIndicatorView alloc] init]; //JGProgressHUDSuccessIndicatorView is also available
[HUD showInView:self.view];
[HUD dismissAfterDelay:3.0];

Showing determinate progress:

JGProgressHUD *HUD = [JGProgressHUD progressHUDWithStyle:JGProgressHUDStyleDark];
HUD.indicatorView = [[JGProgressHUDPieIndicatorView alloc] init]; //Or JGProgressHUDRingIndicatorView
HUD.progress = 0.5f;
[HUD showInView:self.view];
[HUD dismissAfterDelay:3.0];

For more examples, including in Swift, see Examples.

Important: You should always show JGProgressHUD in a UIViewController view.

Customization

Styles:

JGProgressHUD can be displayed in 3 styles:

  • Extra Light
  • Light
  • Dark

Indicator Views:

By default a HUD will display an indeterminate progress indicator. The indicator view can be completely hidden by setting the indicatorView property to nil. These indicator views are available by default:

  • Indeterminate progress indicator
  • Pie progress indicator
  • Ring progress indicator
  • Success indicator
  • Error indicator
  • Image indicator

Custom indicator views can be created by subclassing JGProgressHUDIndicatorView.

Animations:

By default a HUD will use a fade animation. Several parameters can be altered such as animation duration or animation curve. A HUD can be displayed without animation and different animations can be used. These animations are available by default:

  • Fade
  • Zoom and Fade

Custom animations can be created by subclassing JGProgressHUDAnimation.

To dim the content behind the HUD set your dim color as backgroundColor of your JGProgressHUD instance.

Installation

Swift Package Manager:

Add JGProgressHUD as a dependency in your Package.swift file:

.package(url: "https://github.com/JonasGessner/JGProgressHUD", .upToNextMajor(from: "2.0.0"))

Carthage:

In your Cartfile add:

github "JonasGessner/JGProgressHUD"

CocoaPods:

In your Podfile add:

pod 'JGProgressHUD'

Manual Installation:

  1. Drag the JGProgressHUD.xcodeproj file into your Xcode project.
  2. Add JGProgressHUD.framework to "Embedded Binaries" in the "General" tab of your target.

After installing import the module where you want to use it:

@import JGProgressHUD;

Swift:

import JGProgressHUD

See the Examples project for an example implementation of JGProgressHUD as framework.

Requirements

  • Base SDK of iOS/tvOS 11.0 or higher.
  • Deployment target of iOS 8.0, tvOS 9.0 or higher.

JGProgressHUD can also be used by projects written in Swift. See Installation for details.

Documentation

Detailed documentation can be found on here.

Each class and method is well documented, making it easy to quickly get a good overview. To start, see JGProgressHUD.h.

License

MIT License.
© 2014-2019, Jonas Gessner.

Credits

Created and maintained by Jonas Gessner, © 2014-2019.

jgprogresshud's People

Contributors

jonasgessner avatar mjwybrow avatar colemancda avatar jeehut avatar aporat avatar gantman avatar ggurantz avatar johncoates avatar keith avatar mallorypaine avatar krzyzanowskim avatar reflejo avatar mplorentz avatar sberrevoets avatar diederich 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.